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
char *sqlite_sanitize( char* str ) | |
{ | |
char *safe_str; | |
int str_len = strlen( str ); | |
int str_bad_chars = 0; | |
for( int i = 0; i < str_len; i++ ) | |
if ( str[i] == '\'' || str[i] == '\"' ) | |
str_bad_chars++; |
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
require 'rubygems' | |
require 'json' | |
require 'net/http' | |
module WunderGround | |
def self.query( city ) | |
api_uri = URI.parse URI.escape( "http://api.wunderground.com/api/~AKI_KEY~/geolookup/conditions/forecast/q/#{city}.json" ) | |
response = Net::HTTP.get_response api_uri | |
data = response.body | |
json = JSON.parse data |
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
FACTORY_DIR = 'spec/factories/' | |
lines = File.open(ARGV[0]).read | |
def write_factory(factory_name, factory_class, factory_lines) | |
factory_file = FACTORY_DIR + factory_name + '.rb' | |
outs = "FactoryGirl.define do\n" | |
outs += " factory :#{factory_name}" | |
outs += ", class: '#{factory_class}'" if factory_class != nil |
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
without wait | |
count: 3040 | |
highest: 0.002497736 | |
lowest: 0.000104346 | |
average: 0.00021010162796052627 | |
with wait | |
count: 3040 | |
highest: 0.021411709 | |
lowest: 0.000494643 |
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 dylanj on github. | |
* I am zqz (https://keybase.io/zqz) on keybase. | |
* I have a public key ASBdic3PcERshrNKqZtWcRVi1BXPA0qUn0QpnnbL77wALQo | |
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
# prints all? domain+tld combos which are available. | |
require 'nokogiri' | |
require "net/http" | |
require "uri" | |
def tldsearch(domain) | |
args = { d: domain, r: 'ALL', freedom: 0, onlydom: 0, option: 0 } | |
endpoint = "https://www.inwx.com/de/domain/check2ajax" | |
req_start = Time.now |
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
@echo off | |
for /f "tokens=1-4 delims=/ " %%i in ("%date%") do ( | |
set dow=%%i | |
set month=%%j | |
set day=%%k | |
set year=%%l | |
) | |
set datestr=%month%_%day%_%year% | |
echo datestr is %datestr% | |