Skip to content

Instantly share code, notes, and snippets.

View r4j4h's full-sized avatar

Jasmine Hegman r4j4h

View GitHub Profile
@samselikoff
samselikoff / xAxis.js
Last active August 29, 2015 13:58
Sample implementation of xAxis component using d3.chart
// Use the axis in the initialize method of your BarChart, like this:
d3.chart('BarChart', {
initialize: function() {
...
chart.xAxis = this.base.select('g').append('g').chart('xAxis', {parent: this});
this.attach('axis', chart.xAxis);
}
@leetreveil
leetreveil / mmfolderscan.js
Created May 19, 2011 19:32
node-musicmetadata folder scan
var fs = require('fs'),
walk = require('walk'),
path = require('path'),
mm = require('musicmetadata');
walker = walk.walk('/Users/leetreveil/Music/Mine', { followLinks : false });
walker.on('file', function(root, fileStats, next) {
if (/^.*\.(mp3|m4a|flac|ogg)/.test(fileStats.name)) {
var fullPath = path.join(root, fileStats.name);
@boformer
boformer / how-to-copy-and-apply-default-lighteffects.cs
Created September 25, 2015 21:54
(Saving Not Supported!) Custom light props in Cities: Skylines
// Warning: Lights made with this script can not be saved!
var lightEffect = EffectCollection.FindEffect("Flood Light Orange") as LightEffect;
// Final position in prop
Vector3 pos = new Vector3(0f,10f,0f);
// this would be in the center of the prop, 10m above ground
// Final direction in prop
Vector3 dir = new Vector3(0f,1f,0f);
@jrideout
jrideout / README.md
Created October 29, 2013 19:11 — forked from mbostock/.block

A quick visual reference to every ColorBrewer scale; colors by Cynthia Brewer. Available in CSS and JS format. Click on a palette to log the constituent colors in hexadecimal RGB to the console.

@nathggns
nathggns / errorception.js
Created September 27, 2013 11:10
Wrap Errorception to provide stack traces in some browsers
window.onerror = (function(old) {
return function() {
var args = [].slice.call(arguments);
for (var i = 0, l = arguments.length; i < l; i++) {
if (args[i] instanceof Error) {
window._errs.push(args[i]);
}
@westonplatter
westonplatter / HomeController.js
Created November 20, 2013 07:16
stream MP3 through SailsJS framework
/**
* HomeController
*
* @module :: Controller
* @description :: Contains logic for handling requests.
*/
module.exports = {
index: function (req,res) {
@pvgomes
pvgomes / gist:9f19e80454bb56565ee9
Created November 19, 2014 11:45
Difference between save and export
As I described in my last post (http://tuhrig.de/difference-between-save-and-export-in-docker), there are two ways to persist a Docker images or container:
A Docker image can be saved to a tarball and loaded back again. This will preserve the history of the image.
# save the image to a tarball
docker save <IMAGE NAME> > /home/save.tar
# load it back
docker load < /home/save.tar
A Docker container can be exported to a tarball and imported back again. This will not preserve the history of the container.
@abreckner
abreckner / waitsForAndRuns.js
Created May 9, 2014 01:56
Jasmine 2 plug in to re-enable waitsFor and runs functionality
// This is the equivalent of the old waitsFor/runs syntax
// which was removed from Jasmine 2
waitsForAndRuns = function(escapeFunction, runFunction, escapeTime) {
// check the escapeFunction every millisecond so as soon as it is met we can escape the function
var interval = setInterval(function() {
if (escapeFunction()) {
clearMe();
runFunction();
}
}, 1);
@hzoo
hzoo / plan.md
Last active July 13, 2018 15:19
Recruiting emails + open source

So I was thinking about how I never respond to recruiter emails, and how their way of try to appeal to me is a bit lacking: work on some framework, create a new framework, be a senior dev/cto, etc.

I was just thinking a bitabout how companies can change to better support open source, so why not respond back with some suggestions?

Can suggest:

  • donating to projects via Open Collective
  • having developer time to contribute back to open source

kops cluster config

kubeAPIServer:
  authorizationMode: RBAC
  authorizationRbacSuperUser: admin
  oidcCAFile: /srv/kubernetes/ca.crt
  oidcClientID: example
  oidcGroupsClaim: groups
  oidcIssuerURL: https://dex.example.com
  oidcUsernameClaim: email