Skip to content

Instantly share code, notes, and snippets.

View hortinstein's full-sized avatar

Alex Hortin hortinstein

View GitHub Profile
@ErikAugust
ErikAugust / spectre.c
Last active April 15, 2024 13:55
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@robdodson
robdodson / element.jade
Created December 19, 2013 23:10
Polymer elements in Jade
- var elementName = '';
block vars
polymer-element(name="#{elementName}")
block element
@klovadis
klovadis / gist:2549131
Created April 29, 2012 10:03
How to use optional arguments in node.js
// example function where arguments 2 and 3 are optional
function example( err, optionalA, optionalB, callback ) {
// retrieve arguments as array
var args = [];
for (var i = 0; i < arguments.length; i++) {
args.push(arguments[i]);
}
// first argument is the error object
@ryanflorence
ryanflorence / app.js
Created February 4, 2011 18:10
Node.JS + Socket.IO + 10 minutes = Chat
/**
* Module dependencies.
*/
var express = require('express')
, io = require('socket.io');
var app = module.exports = express.createServer();
// Configuration