Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Clif Reeder clifff

🏠
Working from home
Block or report user

Report or block clifff

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@clifff
clifff / add_auto_increment_to_int_single_pk.sql
Created Jan 11, 2019 — forked from carlosrobles/add_auto_increment_to_int_single_pk.sql
Add auto_increment to all the single PRIMARY KEY of type int of a database
View add_auto_increment_to_int_single_pk.sql
DROP TABLE if exists temp;
CREATE TABLE temp (
`table` varchar(250) DEFAULT NULL,
`colum` varchar(250) DEFAULT NULL,
`type` varchar(250) DEFAULT NULL,
`number_of_PK` tinyint(2) DEFAULT NULL,
`alter` varchar(250) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
@clifff
clifff / client_user_data.txt
Last active Aug 29, 2015
Private WPT setup
View client_user_data.txt
wpt_server=YOUR_PUBLIC_DNS wpt_location=EC2-WPT
View gist:5471511
1.9.3p392 :003 > arr = []; arr[10000000000000001] = 1
irb(16545,0x7fff795b9180) malloc: *** mmap(size=80000000000004096) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
irb(16545,0x7fff795b9180) malloc: *** mmap(size=80000000000004096) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
NoMemoryError: failed to allocate memory
from (irb):3:in `[]='
from (irb):3
@clifff
clifff / C-large-1.in
Created Apr 21, 2013
Google Code Jam - Fair and Square Large Input 1
View C-large-1.in
10001
1002001 1004006004002
14541 102030301
44944 1022325232202
1000001999901 1211124711121
2617287827163 4000008000005
1 101
1022325232201 1213326733121
44943 12345654321
42874 103045301
@clifff
clifff / palindrome.rb
Last active Dec 16, 2015
string vs integer palindrome benchmarks
View palindrome.rb
require 'benchmark'
def int_pal?(num)
n = num
reverse = 0
while (num > 0)
dig = num % 10
reverse = reverse * 10 + dig
num = num / 10
end
@clifff
clifff / comments.json
Last active Dec 12, 2015
Comment mapping
View comments.json
This file has been truncated, but you can view the full file.
@clifff
clifff / gist:4171017
Created Nov 29, 2012
URI.parse vs regex
View gist:4171017
require 'URI'
require 'benchmark'
include Benchmark
urls = %W{
http://www.theverge.com/posts/comment
http://www.thefalcoholic.com/posts/ajax_comments_update/3468659?last_version=128
http://www.polygon.com/game/dead-island-riptide/3635
http://www.arrowheadpride.com/rss2/index.xml
http://www.broadstreethockey.com/
@clifff
clifff / gist:4066973
Created Nov 13, 2012
HTC Thunderbolt ADB Logs
View gist:4066973
D/dalvikvm(14127): GC_CONCURRENT freed 1056K, 58% free 5146K/11975K, external 1168K/1313K, paused 3ms+6ms
D/skia (14127): purging 193K from font cache [28 entries]
D/skia (14127): createPlugin (300,150) screen proportion:(w,h)=(0.791557,0.057826), content ratio:2.000000 mainUrl:http://athleticsnation.local:3000/2012/10/23/3543068/simple-question-giants-or-tigers
D/skia (14127): createPlugin F10 typical2 video content (300,150)/(379,2594), url=
D/webcore (14127): [WebViewCore::handleMessage] handle msg=[4::120] over 1 sec. (1038.0
D/skia (14127): purging 193K from font cache [27 entries]
D/dalvikvm(14127): GC_CONCURRENT freed 1825K, 63% free 4497K/11975K, external 1168K/1313K, paused 3ms+6ms
D/webcore (14127): [WebViewCore::checkBlock] mHandleClass=3 mHandleMsgId=1 mHandleStartTime=385.0 hascode-0=1079596336
D/webcore (14127): [WebViewCore::checkBlock] == m_bIsPauseTimes=false, mLastHandleMsg=null --d1=1.352745715978E12 d2=948.0
W/ContentService( 1646): binderDied() at ObserverNode name allowed_geo
@clifff
clifff / gist:4066952
Created Nov 13, 2012
HTC Thunderbolt ADB Log 2/3
View gist:4066952
I/PhoneInfo(12047): getLteLevel - lteRsrp: -1 lteCqi:-1
D/dalvikvm(14225): GC_CONCURRENT freed 3368K, 50% free 5921K/11655K, external 211K/532K, paused 2ms+3ms
D/dalvikvm(14225): GC_CONCURRENT freed 2250K, 60% free 4725K/11655K, external 211K/532K, paused 2ms+5ms
D/dalvikvm(14225): GC_CONCURRENT freed 661K, 60% free 4669K/11655K, external 211K/532K, paused 3ms+3ms
D/dalvikvm(14225): GC_CONCURRENT freed 599K, 61% free 4645K/11655K, external 211K/532K, paused 2ms+2ms
D/dalvikvm(14225): GC_CONCURRENT freed 551K, 60% free 4681K/11655K, external 211K/532K, paused 3ms+3ms
D/dalvikvm(14225): GC_EXPLICIT freed 210K, 61% free 4612K/11655K, external 211K/532K, paused 35ms
D/dalvikvm(14225): GC_EXTERNAL_ALLOC freed 27K, 61% free 4584K/11655K, external 211K/532K, paused 38ms
D/skia (14225): createPlugin (300,150) screen proportion:(w,h)=(0.813008,0.039288), content ratio:2.000000 mainUrl:http://athleticsnation.local:3000/
D/skia (14225): createPlugin F10 typical2 video content (300,150)/(369,3818), url=
You can’t perform that action at this time.