This file contains hidden or 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 | |
| # ############################################################# | |
| # 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) | |
| # ############################################################# |
This file contains hidden or 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
| 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] |
This file contains hidden or 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
| /** | |
| * How appcode formats block comments. | |
| */ | |
| /** | |
| * How everyone else formats block comments. | |
| */ |
This file contains hidden or 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
| unsigned long clicks = clock() - g_timer; | |
| NSLog(@"It took me %ld clicks (%f msec).\n",clicks,1000*((float)clicks)/CLOCKS_PER_SEC); |
This file contains hidden or 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
| ; 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 |
This file contains hidden or 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 something | |
| var semver = require('semver'); | |
| var s = semver.satisfies('1.1.1', '~1.1'); | |
| alert(s); | |
This file contains hidden or 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
| <div class="graph" /> |
This file contains hidden or 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
| /** | |
| * Daniel's Experiment | |
| */ | |
| .pattern | |
| { | |
| background: repeating-linear-gradient(90deg, #FFFFFF 0px, #FF0000 10px, | |
| #EEEEEE 11px, #EEEEEE 12px); | |
| background-width: 100%; | |
| background-height: 100%; |
This file contains hidden or 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 | |
| sshdir=$HOME/.ssh | |
| # ensure directory exists | |
| mkdir -p "$sshdir/" | |
| if [ -e "$sshdir/id_rsa.pub" ] | |
| then | |
| echo "Your SSH key already exists." |
This file contains hidden or 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
| #!/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=([^"|^&]*)/ |