- 🎨 when improving the format/structure of the code
- 🚀 when improving performance
- ✏️ when writing docs
- 💡 new idea
- 🚧 work in progress
- ➕ when adding feature
- ➖ when removing feature
- 🔈 when adding logging
- 🔇 when reducing logging
- 🐛 when fixing a bug
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
$ heroku config:set MAGICK_MAP_LIMIT=32MiB | |
Setting MAGICK_MAP_LIMIT and restarting ⬢ radiant-waters-37422... done, v46 | |
MAGICK_MAP_LIMIT: 32MiB | |
$ heroku config:set MAGICK_MEMORY_LIMIT=16MiB | |
Setting MAGICK_MEMORY_LIMIT and restarting ⬢ radiant-waters-37422... done, v47 | |
MAGICK_MEMORY_LIMIT: 16MiB | |
$ heroku run identify -list resource | |
Running identify -list resource on ⬢ radiant-waters-37422... up, run.5905 (Hobby) |
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
require 'nokogiri' | |
require 'open-uri' | |
require 'json' | |
doc = Nokogiri::HTML(open('http://www.mysupermarket.co.uk/asda-compare-prices/Spirits/Havana_Club_Rum_Anejo_7_Year_Old_700ml.html')) | |
prices = doc.css('#PriceComparison .StoreDiv').map {|c| { name: c.css('.ImgSpan img').first['alt'], cheapest: c['class'].include?('Cheapest'), price: c.css('.Price>span.priceClass, .Price>span.Offer').text.strip } } | |
# => [{:name=>"ASDA", :cheapest=>true, :price=>"£18.00"}, | |
# {:name=>"Tesco", :cheapest=>false, :price=>"£23.30"}, | |
# {:name=>"Ocado", :cheapest=>false, :price=>"£23.30"}, |
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
/** | |
* IE 5.5+, Firefox, Opera, Chrome, Safari XHR object | |
* | |
* @param string url | |
* @param object callback | |
* @param mixed data | |
* @param null x | |
*/ | |
function ajax(url, callback, data, x) { | |
try { |
Creates a resulting server.crt
certificate and server.key
private key.
$ openssl genrsa -des3 -out server.key.tmp 1024
- Note: Enter a dummy pass pharse (e.g.
1234
) and remember it
- Note: Enter a dummy pass pharse (e.g.
$ openssl rsa -in server.key.tmp -out server.key
- Enter dummy pass pharse from previous step
- Generate certificate request file (CSR)
$ openssl req -new -key server.key -out server.csr
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 | |
. ramdisk.sh | |
. mysql-spawn.sh | |
. postgres-spawn.sh | |
. mysql-start.sh | |
. postgres-start.sh | |
sleep 1 | |
. createdbs.sh | |
. jenkins-start.sh |
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/bash | |
# Create the directory structure | |
mkdir -p features/step_definitions | |
mkdir -p features/support | |
# Create a placeholder for the step_definitions folder | |
touch features/step_definitions/"$(basename `pwd`)_steps.rb" | |
# Create the environment file |
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
property baseURL : "http://statusboard.dev/song?" | |
if application "Spotify" is running then | |
tell application "Spotify" | |
set theTrack to name of the current track | |
set theArtist to artist of the current track | |
set theAlbum to album of the current track | |
set theurl to spotify url of the current track | |
try | |
do shell script "/usr/local/bin/wget --delete-after \"" & baseURL & "&t=" & theTrack & "&a=" & theArtist & "&al=" & theAlbum & "\"" |
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf
using homebrew.
NewerOlder