Skip to content

Instantly share code, notes, and snippets.

Lance Pollard lancejpollard

Block or report user

Report or block lancejpollard

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
View Quirks of

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope []

struct foo {
   struct bar {
       int x;
nikAizuddin / NASMx86: Allocate heap memory
Created Oct 12, 2014
Example using brk() system call for dynamic memory allocations
View NASMx86: Allocate heap memory
; 1 2 3 4 5 6 7
;| |
;| Example using brk() system call for dynamic memory allocations. |
;| |
;| DON'T CONFUSE that brk() used in C Function is different with brk() |
;| systemcall (systemcall 45 for x86 ASM). |
;| |
kachayev /
Last active Nov 7, 2019
Parsing CSS file with monadic parser in Clojure
staltz /
Last active Nov 14, 2019
The introduction to Reactive Programming you've been missing
maxogden / index.js
Last active Oct 17, 2016 — forked from sethvincent/index.js
requirebin sketch
View index.js
var inherits = require('inherits');
var Game = require('crtrdg-gameloop');
var Entity = require('crtrdg-entity');
var Keyboard = require('crtrdg-keyboard');
inherits(Player, Entity);
function Player(options){
this.position = {
x: options.position.x,
View config.js
* Module dependencies.
var pkg = require('../package');
var env = process.env.NODE_ENV || 'development';
* Return setting `name`.
cartazio /
Last active May 28, 2019
xcode 5 + OS X 10.9 mavericks GHC work around nuttiness


just use GHC for OSX

the rest of these directions are preserved for historical purposes

TLDR version, if you have homebrew

xcode-select --install ; brew tap homebrew/versions ;   brew tap homebrew/dupes \
FiloSottile / 32.asm
Last active Nov 7, 2019
NASM Hello World for x86 and x86_64 Intel Mac OS X (get yourself an updated nasm with brew)
View 32.asm
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
push dword msg.len
push dword msg
push dword 1
mov eax, 4
francoishill / gist:6483997
Created Sep 8, 2013
Media queries for mobile devices - Requires at least requires the meta viewport tag with content 'width=device-width'
View gist:6483997
/*At least requires the meta viewport tag with content 'width=device-width'*/
@media only screen and (max-width: 1080px) and (orientation : portrait) {
Windows Surface Pro*/
@media only screen and (max-width: 800px) and (orientation : portrait) {
Acer Iconia Tab A100
You can’t perform that action at this time.