Skip to content

Instantly share code, notes, and snippets.

<?php
// Basically a strict object with no methods
class Struct {
public $foo;
public $bar;
}
$struct = new Struct(['foo' => 'something']); // constructor args would get pushed to properties ???
$struct->foo = 'whatever';
@dcousineau
dcousineau / gulpfile.js
Created April 9, 2015 14:07
Gulp Build System
"use strict";
var _ = require('underscore')
, nodeResolve = require('resolve')
, gulp = require('gulp')
, gutil = require('gulp-util')
, browserify = require('browserify')
, watchify = require('watchify')
, babelify = require('babelify')
, source = require('vinyl-source-stream')
@kwylez
kwylez / gist:5337918
Last active March 2, 2020 06:09
Example implementation of listening for iTunes/Spotify track changes and displaying information in the NotificationCenter. Article reference: http://blog.corywiles.com/now-playing-with-spotify-and-itunes
//
// AppDelegate.m
//
//
// Created by Cory D. Wiles on 10/8/12.
// Copyright (c) 2013 Cory D. Wiles. All rights reserved.
//
#import "AppDelegate.h"
#import "iTunes.h"
@ncb000gt
ncb000gt / elasticsearch-index-config.js
Created March 10, 2011 15:40
Elastic search configuration with a custom analyzer.
{
settings: {
number_of_shards: 5,
number_of_replicas: 1,
"index" : {
"analysis" : {
"analyzer" : {
"html" : {
filter: [ 'standard', 'lowercase', 'stop', 'asciifolding' ],
"tokenizer" : "standard",
@sanxiyn
sanxiyn / lisp.c
Created August 14, 2010 04:16
Lisp
#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
enum type {
NIL,