This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style> | |
.copyable { | |
display: inline-block; | |
padding: 4px; | |
border-radius: 4px; | |
border: 1px solid #ccc; | |
} |
echo "
rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
" | sudo pfctl -ef -
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ImagemagickAT6 < Formula | |
desc "Tools and libraries to manipulate images in many formats" | |
homepage "https://www.imagemagick.org/" | |
# Please always keep the Homebrew mirror as the primary URL as the | |
# ImageMagick site removes tarballs regularly which means we get issues | |
# unnecessarily and older versions of the formula are broken. | |
url "https://dl.bintray.com/homebrew/mirror/imagemagick%406-6.9.8-10.tar.xz" | |
mirror "https://www.imagemagick.org/download/ImageMagick-6.9.8-10.tar.xz" | |
sha256 "8fc268f6e1bc514b41620e0f3f6c5dd33bfc5169db679e9a5c0455c6edd11810" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts '1234' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
I hereby claim:
- I am ryanwjackson on github.
- I am ryanwjackson (https://keybase.io/ryanwjackson) on keybase.
- I have a public key whose fingerprint is 3CFD CD47 46A8 EB8C 9C75 C5E1 7F23 995D 67A9 B320
To claim this, I am signing this object:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "What should the Application be called (no spaces allowed e.g. GCal)?" | |
read inputline | |
name="$inputline" | |
echo "What is the url (e.g. https://www.google.com/calendar/render)?" | |
read inputline | |
url="$inputline" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def wrap_in_transaction | |
ActiveRecord::Base.transaction do | |
current_account.with_lock('FOR UPDATE') do | |
begin | |
yield | |
ensure | |
raise ActiveRecord::Rollback | |
end | |
end | |
end |
Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.
Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.
- Get an OAuth Token from GitHub
First you will need to get an OAuth Token from GitHub using your own username and "note"
NewerOlder