Skip to content

Instantly share code, notes, and snippets.

View timkock's full-sized avatar

Tim Kock timkock

  • Lisbon, Portugal
View GitHub Profile
/* eslint-disable no-param-reassign */
/* eslint-disable object-curly-newline */
// requirements
const ws = require('ws');
const { SubscriptionServer } = require('subscriptions-transport-ws');
const { formatApolloErrors } = require('apollo-server-errors');
const { execute, subscribe } = require('graphql');
// export patch
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
</head>
<body>
<script id="jsbin-javascript">
var width = 960,
@timkock
timkock / bootstrap.sh
Last active March 17, 2017 14:53
AZURE NV* BOOTSTRAP SCRIPT
#!/bin/sh -e
# /etc/rc.local
### BEGIN INIT INFO
# Provides: vmbootstrap
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: vmbootstrap
@timkock
timkock / weather.ipynb
Last active January 25, 2017 16:23
simple notebook to get to demonstrate notebooks to the uninitiated
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@timkock
timkock / format.js
Last active January 25, 2016 07:45
json re-formatter
// npm install lodash glob
// dependencies
var glob = require('glob');
var _ = require('lodash');
var path = require('path');
var fs = require('fs');
// unformatted files are in a subfolder 'index'
// output subfolder 'parsed' has already been made
@timkock
timkock / rmnodemodules.sh
Created December 6, 2015 14:10
removes nested node_modules directories to clean unwanted data for backup or other purposes
find . -name "node_modules" -exec rm -rf '{}' +
@timkock
timkock / sing.js
Last active December 2, 2015 11:57
sing.js
'use strict';
// instructions
// 0. save this code to sing.js
// 1. npm install request cheerio commander
// 2. node sing.js -l http://tinyurl.com/qxmreql -s 50
// dependencies
var request = require('request')
, cheerio = require('cheerio')
@timkock
timkock / hugs.js
Last active October 21, 2015 10:31
Everyone needs some love
'use strict';
/////////////////////
// COLLECTIEF HUGS //
/////////////////////
// dependencies
var inquirer = require('inquirer')
, nyanstream = require('nyanstream')
, colors = require('colors')