This file contains 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
var step_number = 0; | |
switch (Shopify.Checkout.step) { | |
case "contact_information": | |
step_number = 1; | |
break; | |
case "shipping_method": | |
step_number = 2; | |
break; |
This file contains 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
var step_number = 0; | |
switch (Shopify.Checkout.step) { | |
case "contact_information": | |
step_number = 1; | |
break; | |
case "shipping_method": | |
step_number = 2; | |
break; |
This file contains 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
var step_number = 0; | |
switch (Shopify.Checkout.step) { | |
case "contact_information": | |
step_number = 1; | |
break; | |
case "shipping_method": | |
step_number = 2; | |
break; |
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am leobossmann on github. | |
* I am bossmann (https://keybase.io/bossmann) on keybase. | |
* I have a public key ASBdS9TQTULT78FPiGc5MJ8PLMW1ksKIdlX47bqNQQs1aQo | |
To claim this, I am signing this object: |
This file contains 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
var imgs = new Array; | |
// replace all images by the xxl version | |
$('li > img').each(function(i, item){ | |
var new_src = $(item).prop('src').replace('large', 'xxlarge'); | |
$(item).prop('src', new_src); | |
imgs.push($(item)); | |
}); | |
// kill everything on page | |
$('body').empty(); |
This file contains 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 | |
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport | |
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport |
This file contains 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
namespace :whatever do | |
desc "Outputs strong parameters for all of a model's attributes, ready to be pasted. Use with caution, it permits *everything*" | |
task :strong_params,[:model] => :environment do |t, args| | |
puts "\nprivate\n\n" | |
puts "def #{args.model.underscore}_params" | |
attributes = " :" + args.model.constantize.new.attributes.except("id", "created_at", "updated_at").keys.join(",\n :") | |
puts " params.require(:#{args.model.underscore}).permit(\n#{attributes}\n)" | |
puts "end" | |
end | |
end |
This file contains 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 | |
function echo_red { | |
echo -e "\033[0;31m$1\033[0m" | |
} | |
function echo_green { | |
echo -e "\033[0;32m$1\033[0m" | |
} | |
function echo_status { |
This file contains 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
typo3's link tags are formatted like this: | |
<link url target css-class title-attribute>Linktext</link> | |
to get all vital info, use this regex: | |
<link\s(\S+)[^"]*(?:"([^"]+)")?>([^<>]+)<\/link> | |
PHP to convert this to markdown and replace the wonderfully helpful default title: | |
$bodytext = preg_replace('/<link\s(\S+)[^"]*(?:"([^"]+)")?>([^<>]+)<\/link>/', "[$3]($1 \"$2\")", $this->bodytext); | |
$bodytext = preg_replace('/\[([^\[\]]+)\]\((\S+)\s{1}\\"Opens external link in new window\\"\)/', "[$1]($2 \"$1\")", $bodytext); | |
$this->bodytext = trim(html_entity_decode(strip_tags($bodytext))); |
This file contains 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 | |
LIMIT=45000000 | |
USAGE=0 | |
for dir in /path/to/stats/*/ | |
do | |
LOCAL_USAGE=`head -n 2 $dir/webalizer.hist | tail -n 1 | cut -d" " -f6` | |
USAGE=$(($USAGE + $LOCAL_USAGE)) | |
done |
NewerOlder