Skip to content

Instantly share code, notes, and snippets.

@joates
joates / index.js
Last active August 29, 2015 13:55
this started with me figuring out a sensible way to call the webgl init() method asynchronously, and then i thought i'd add some nervy boxes in a ring pattern (demo here -> http://joat.es/webgl/twitchy-ringer/)
var webgl = require('./webgl')
, boxes = 32
webgl.init(boxes, function(err, data) {
if (err) console.error('init failed')
console.log('ready', data)
})
@joates
joates / threejs-editor-scene-export.json
Created February 25, 2014 13:54
http://threejs.org/editor >> File >> Import (note: add an Env Map image to the Box & change View >> Dark theme)
{
"metadata": {
"version": 4.3,
"type": "Object",
"generator": "ObjectExporter"
},
"geometries": [
{
"uuid": "892D4DF7-229E-4DF8-BFFD-083D7AE16140",
"type": "CylinderGeometry",
@joates
joates / bookmarks.html
Last active August 29, 2015 13:57
DevOps bookmarks (21-Mar-2014) should be able to 'import' this file directly into your browsers bookmarks/favorites bar, or just open it normally.
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<H1>DevOps resources</H1>
<DL><p>
<DT><H3 ADD_DATE="1389300807" LAST_MODIFIED="1395376185">VPS (info &amp; tips)</H3>
<DL><p>
<DT><A HREF="https://www.digitalocean.com/community/articles/how-to-set-up-couchdb-with-elasticsearch-on-an-ubuntu-13-10-vps" ADD_DATE="1389300764" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABzklEQVQ4jdVSwWpTURScc+6t7wW1GilUMQt9xYUKoq2J3aQEibiQ0lWz1H8QoSotXGKaFhE3/kERF1F3gpa+ZmGQYElQlOqqgoLYUm1prH1p8u69bgw0EcRtZ3WYwwxnDgPselAncVoV9rhuNGGNJsetVcrXM8F/GwxMzvcD9IS1WYZACBOeMF1i1PPWy1+Wes5ubn9/v6gyjZ0abg0ppSRb+1jAVI2wkw47IxTyMGnOfFs60m2trbhu9HDnBRIA4lO+FxhOkQ2Nbm5fq6rhrT/7SjzrPw1EfaJ66xIlcsUSgGRbhME7z1OanRkLPGBr9MJ4+n5brOm5A9WxdA1EtsUlcsWSZv1IwqwinvfnB7OzF/71qJYIAM7n/XcAEM/6nwem5p5Jo02ohTwJ4HVKKbkmhvq0DjYW1ZXlnQYL4xeTAFC5nT6TyBVLWupkvd5o0Lnp2SHWQgnLZXB43EIaCxxlE8YAWeAu/dAGK1/l1n776u7Iz9FCQXz6EIl6p4L1j2+dHgKA/vyLJBPHRIhDVoqDxuomaV
;(function (d) {
Drupal.behaviors.noThanksIllUseJavascript = {
attach: function (context, settings) {
// initialize
while(d.body.firstChild) {
d.body.removeChild(d.body.firstChild)
}
@joates
joates / getnum-patch.sh
Last active August 29, 2015 14:02
[bash] extracts version info from package.json ( \1= Major \2=Minor \3=Patch )
# example usage
# -------------
# "version": "1.2.3-beta"
#
# value captured by `sed -e`
# --------------------------
#
# \1 = 1 (major)
# \2 = 2 (minor)
# \3 = 3-beta (patch)
@joates
joates / keybase.md
Created August 27, 2014 11:28
keybase.io verify

Keybase proof

I hereby claim:

  • I am joates on github.
  • I am joates (https://keybase.io/joates) on keybase.
  • I have a public key whose fingerprint is C91E 057B 45C8 0E57 5D7D AF27 F665 0811 4B33 8905

To claim this, I am signing this object:

@joates
joates / mmmovies_api.misc.inc
Last active August 29, 2015 14:05
for reference: here is the Drupal / PHP version of my Mmmovies project (i think i did this about 2 years ago) it works really well actually, it's quite a lot of code though (at over 1k LoC) in the main file, plus a tiny bit more in the include file.
<?php
/**
* @file
* Miscellaneous supporting functions.
*/
/**
* Returns a structured array defining the fields bundled with this content type.
@joates
joates / label-style-tag.css
Last active August 29, 2015 14:06
website taxonomy tags that look like green luggage labels (uses CSS3 transform & gradient) demo image -> http://i.imgur.com/X3vARcK.png
/** Tags that look like labels (CSS3) **/
a.label-style-tag {
display: inline-block;
padding: 0px 10px;
height: 30px;
line-height: 30px;
border-radius: 5px;
font-weight: bold;
font-size: 0.9em;
text-decoration: none; }
@joates
joates / js-mvc-choices.md
Last active August 29, 2015 14:06
A few alternatives to Sails.js.. (Javascript MVC-style framewonks)
@joates
joates / index.js
Created September 15, 2014 03:05
code to join some JSON files into one Object..
var fs = require('fs')
, extend = require('extend')
, async = require('async')
, obj = {}
var files = [
'001-050.json'
, '051-100.json'
, '101-150.json'
, '151-200.json'