Skip to content

Instantly share code, notes, and snippets.

@simongcc
simongcc / config.rb
Last active April 25, 2017 04:36 — forked from yatil/config.rb
My standard config.rb for compass
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "img"
javascripts_dir = "js"
# You can select your preferred output style
@simongcc
simongcc / .block
Created April 16, 2017 03:31 — forked from mbostock/.block
The Gist to Clone All Gists
license: gpl-3.0
@simongcc
simongcc / 0_reuse_code.js
Created April 27, 2017 17:31
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@simongcc
simongcc / best-localStorage-polyfill-evar.js
Created July 26, 2017 08:10 — forked from juliocesar/best-localStorage-polyfill-evar.js
This is the best localStorage polyfill in the world
// I mean, seriously, localStorage is supported even by your mum. How about instead of
// casing the feature out, you give users in-memory (stale) storage instead?
// If they close your application, they deserve to lose data anyway.
// if (!('localStorage' in window)) {
if (!Modernizr.localstorage) {
window.localStorage = {
_data : {},
setItem : function(id, val) { return this._data[id] = String(val); },
getItem : function(id) { return this._data.hasOwnProperty(id) ? this._data[id] : undefined; },
@simongcc
simongcc / ramdisk.sh
Created October 3, 2017 07:49 — forked from rxin/ramdisk.sh
ramdisk create/delete on Mac OS X.
#!/bin/bash
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/
#
ARGS=2
E_BADARGS=99
if [ $# -ne $ARGS ] # correct number of arguments to the script;
then
@simongcc
simongcc / repeat.js
Created January 7, 2018 09:31 — forked from nathansmith/repeat.js
Handlebars.js helper to generate dummy UI.
/*
Handlebars helper to generate dummy UI.
For instance, a 10x10 table with 100 cells:
<table>
{{#repeat 10}}
<tr>
{{#repeat 10}}
<td>
@simongcc
simongcc / index.php
Created January 3, 2019 12:23 — forked from johndyer/index.php
Gutenberg Shortcode Block with Live Preview
<?php
/**
* Plugin Name: JD Gutenberg Shortcode Preview
* Description: Live shortcode previews in Gutenberg
* Author: johndyer
* Version: 1.0.0
*
*/
// Exit if accessed directly.
@simongcc
simongcc / macOS-in-virtualbox.md
Created March 15, 2019 06:12 — forked from rob-smallshire/macOS-in-virtualbox.md
Notes on getting macOS Sierra running in Virtualbox on a Windows 10 host

On Mac

Download, but don't run, the Sierra installer from the Mac App Store. This places the installer at /Applications/Install\ macOS\ Sierra.app/.

Now run the following commands to build a suitable VM image from the installer:

git clone https://github.com/jonanh/osx-vm-templates
cd osx-vm-templates/packer

sudo ../prepare_iso/prepare_vdi.sh -D DISABLE_REMOTE_MANAGEMENT -o macOS_10.12.vdi /Applications/Install\ macOS\ Sierra.app/ .

@simongcc
simongcc / threejsBoilerplate.html
Created April 2, 2019 07:37 — forked from HalfdanJ/threejsBoilerplate.html
THREE.JS Boilerplate with controls
<!doctype html>
<html>
<head>
<title>Three.js Boilerplate</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r79/three.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/stats.js/r16/Stats.min.js"></script>
@simongcc
simongcc / dabblet.css
Created April 6, 2019 06:36 — forked from JoelBesada/dabblet.css
CSS States
/* CSS States */
body {
background: url(http://dabblet.com/img/noise.png);
background-color: #F5F2F0;
font-family: Georgia, serif;
font-size: 18px;
line-height: 1.6em;
text-shadow: 0 2px 0 white;
color: #222;
}