Skip to content

Instantly share code, notes, and snippets.

@Pegolon
Pegolon / gist:1851436
Created February 17, 2012 07:02
Showing clang predefined macros
> find /Applications/Xcode.app -name clang
# Pick one
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c /dev/null -dM -E
@cmalven
cmalven / index.html
Last active April 27, 2024 10:17
Shortest (useful) HTML5 Document
<!-- http://www.brucelawson.co.uk/2010/a-minimal-html5-document/ -->
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>blah</title>
</head>
<body>
<p>I'm the content</p>
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@ViViDboarder
ViViDboarder / FilcoTweaks.ahk
Created December 31, 2012 14:48
Some hotkeys designed for my Filco Majestouch 2
;-- On Startup
vol_Step = 3
;-- Hotkeys
;-- Volume adjust
HotKey #PgUp, volUp ; Win+Page Up
HotKey #PgDn, volDn ; Win+Page Down
HotKey #End, volMute ; Win+End
;-- Browser Navigation
HotKey !#Left, browserBack ; Ctrl+Win+Left
@hamaluik
hamaluik / AABB.hx
Created October 6, 2014 05:38
Continuous collision detection between two moving AABBs using Minkowski differences.
package ;
import openfl.display.Sprite;
/**
* ...
* @author Kenton Hamaluik
*/
class AABB
{
public var center:Vector = new Vector();
@zhiguangwang
zhiguangwang / websocket-elb.md
Last active April 23, 2019 20:23
Configure websockets behind an AWS ELB.
@raulanatol
raulanatol / 01_websockets_nginx.config
Created April 12, 2016 08:27
Configure nginx to accept websockets on AWS Elastic Beanstalk
files:
"/etc/nginx/conf.d/01_websockets.conf":
mode: "000644"
owner: root
group: root
content: |
upstream nodejs {
server 127.0.0.1:8081;
keepalive 256;
}
@njlr
njlr / raleigh-frame-serial-numbering-system.md
Created August 9, 2016 14:34
The numbering system used for Raleigh bicycle frames

For Your Information: Frame Serial Numbering System

The location of our frame serial numbers will be on the top of the seat tube facing to the rear of the bicycle. This does not apply to models with 531 seat tubes which will be numbered under the bottom bracket. Markings show the source of manufacture, approximate date of manufacture and unique number of each frame manufactured in any 10 year cycle.

Size of letters and numbers 3/16" high, to match diameter of tubes. The complete stamp contains nine digits.

FIRST SYMBOL Denotes Location of Manufacture

Symbol | Location

@danielrw7
danielrw7 / replify
Last active October 24, 2023 12:03
replify - Create a REPL for any command
#!/bin/sh
command="${*}"
printf "Initialized REPL for `%s`\n" "$command"
printf "%s> " "$command"
read -r input
while [ "$input" != "" ];
do
eval "$command $input"
printf "%s> " "$command"
@kekyo
kekyo / option.fs
Created July 3, 2017 23:51
F# option computation expression
[<Struct>]
type OptionalBuilder =
member __.Bind(opt, binder) =
match opt with
| Some value -> binder value
| None -> None
member __.Return(value) =
Some value
let optional = OptionalBuilder()