Skip to content

Instantly share code, notes, and snippets.

View sublimecoder's full-sized avatar

Jared Smith sublimecoder

View GitHub Profile
SELECT
zipcode
(
3959 * acos(
cos(radians($LattitudeVar)) * cos(radians(latitude)) * cos(
radians(longitude) - radians($longitudeVar)
) + sin(radians($LattitudeVar)) * sin(radians(latitude))
)
) AS distance
FROM
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
alias todo='$EDITOR ~/.todo'
alias gclean="git branch | grep -v "master" | xargs git branch -D"
# Handle the fact that this file will be used with multiple OSs
platform=`uname`
if [[ $platform == 'Linux' ]]; then
alias a='ls -lrth --color'
elif [[ $platform == 'Darwin' ]]; then
alias a='ls -lrthG'
fi
def pizza(toppings)
toppings.map do |topping|
"I love #{topping} pizza!"
end
end
toppings = %w(pepperoni mushroom bacon pineapple)
def pizza(toppings)
toppings.map do |topping|
puts "I love #{topping} pizza!"
end
end
@sublimecoder
sublimecoder / tmux-cheatsheet.markdown
Last active August 29, 2015 14:27 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
#!/bin/bash +x
MYDIR=/home/username
# force load new code
cd $MYDIR
git fetch origin
git reset --hard origin/master
# move domain specific files
@sublimecoder
sublimecoder / url_testing_challenge.rb
Last active August 29, 2015 14:02
Testing Challenge
require 'rubygems'
require 'json'
require 'httpclient'
start = "http://letsrevolutionizetesting.com/challenge?format=json"
def go_to_url url
client = HTTPClient.new
httpresult = client.get_content(url)
JSON.parse(httpresult)
end
@sublimecoder
sublimecoder / bot-blocking-expression
Last active September 19, 2023 14:37
IIS Regex Bot Blocking Rule
^$|EasouSpider|Add Catalog|PaperLiBot|Spiceworks|ZumBot|RU_Bot|Wget|Java/1.7.0_25|Slurp|FunWebProducts|80legs|Aboundex|AcoiRobot|Acoon Robot|AhrefsBot|aihit|AlkalineBOT|AnzwersCrawl|Arachnoidea|ArchitextSpider|archive|Autonomy Spider|Baiduspider|BecomeBot|benderthewebrobot|BlackWidow|Bork-edition|Bot mailto:craftbot@yahoo.com|botje|catchbot|changedetection|Charlotte|ChinaClaw|commoncrawl|ConveraCrawler|Covario|crawler|curl|Custo|data mining development project|DigExt|DISCo|discobot|discoveryengine|DOC|DoCoMo|DotBot|Download Demon|Download Ninja|eCatch|EirGrabber|EmailSiphon|EmailWolf|eurobot|Exabot|Express WebPictures|ExtractorPro|EyeNetIE|Ezooms|Fetch|Fetch API|filterdb|findfiles|findlinks|FlashGet|flightdeckreports|FollowSite Bot|Gaisbot|genieBot|GetRight|GetWeb!|gigablast|Gigabot|Go-Ahead-Got-It|Go!Zilla|GrabNet|Grafula|GT::WWW|hailoo|heritrix|HMView|houxou|HTTP::Lite|HTTrack|ia_archiver|IBM EVV|id-search|IDBot|Image Stripper|Image Sucker|Indy Library|InterGET|Internet Ninja|internetmemory|ISC Systems iRc
@sublimecoder
sublimecoder / flashChecker.js
Created May 5, 2014 16:52
Simple script for checking if the browser has flash enabled. Most often used for swapping a slide show element.
var hasFlash = false;
try {
var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
if(fo) hasFlash = true;
}catch(e){
if(navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) hasFlash = true;
}