Skip to content

Instantly share code, notes, and snippets.

View dwabyick's full-sized avatar

Daniel Wabyick dwabyick

View GitHub Profile
@dwabyick
dwabyick / kill_child_processes.sh
Created June 13, 2021 15:20
kill_child_processes.sh
#!/bin/bash
# #############################################################
# Kill all descendent processes of the given process number.
# Pass true to kill the given process itself, false otherwise.
#
# e.g.
# kill_child_processes 123 (does not kill 123)
# kill_child_processes 123 true (kills 123)
# #############################################################
@dwabyick
dwabyick / appcode_sample.txt
Created November 20, 2017 17:11
AppCode hang
Sampling process 852 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling appcode (pid 852) every 1 millisecond
Process: appcode [852]
Path: /Applications/AppCode.app/Contents/MacOS/appcode
Load Address: 0x10c4e3000
Identifier: com.jetbrains.AppCode
Version: 2017.2.6 (OC-172.4343.31)
Code Type: X86-64
Parent Process: ??? [1]
@dwabyick
dwabyick / style.cpp
Created August 22, 2015 15:48
Appcode commenting style
/**
* How appcode formats block comments.
*/
/**
* How everyone else formats block comments.
*/
unsigned long clicks = clock() - g_timer;
NSLog(@"It took me %ld clicks (%f msec).\n",clicks,1000*((float)clicks)/CLOCKS_PER_SEC);
@dwabyick
dwabyick / fib_even
Created November 29, 2014 01:30
Sum the even fibonaccis less than MAX
; basic fib series, using memoized recursion
(defn fib
[n]
(if (= n 1)
1
(if (= n 2)
2
(+ (fib-memo (dec n)) (fib-memo (dec (dec n)))))))
; memoized for speed
@dwabyick
dwabyick / index.js
Created January 27, 2014 06:09
requirebin sketch
// require something
var semver = require('semver');
var s = semver.satisfies('1.1.1', '~1.1');
alert(s);
@dwabyick
dwabyick / index.html
Created November 13, 2012 17:19
A CodePen by Daniel Wabyick. Graph paper - This is a simple graph paper background. Its on a DIV so we can play with inverting the colors, etc.
<div class="graph" />
@dwabyick
dwabyick / dabblet.css
Created November 10, 2012 00:41
Daniel's Experiment
/**
* Daniel's Experiment
*/
.pattern
{
background: repeating-linear-gradient(90deg, #FFFFFF 0px, #FF0000 10px,
#EEEEEE 11px, #EEEEEE 12px);
background-width: 100%;
background-height: 100%;
#!/bin/bash
sshdir=$HOME/.ssh
# ensure directory exists
mkdir -p "$sshdir/"
if [ -e "$sshdir/id_rsa.pub" ]
then
echo "Your SSH key already exists."
@dwabyick
dwabyick / gist:3362045
Created August 15, 2012 18:13
Basic YouTube ID parser for an HTML page
#!/usr/bin/ruby
require 'uri'
require 'net/http'
# Output YouTube ID's, one per line from a URL.
url = 'http://www.youtube.com/'
res = Net::HTTP.get_response( URI.parse( url ) )
reg = /href="\/watch\?v=([^"|^&]*)/