Skip to content

Instantly share code, notes, and snippets.

View garth's full-sized avatar

Garth Williams garth

View GitHub Profile

Keybase proof

I hereby claim:

  • I am garth on github.
  • I am garthw (https://keybase.io/garthw) on keybase.
  • I have a public key ASCbrYdBQl2XRHArhXi1mNP2LYfoQV28BuArnB4uknDI7go

To claim this, I am signing this object:

@garth
garth / CurvedText.js
Created December 22, 2017 10:41
React component for making curved text
/*
Draws text around a circule (the object).
Text is centered at the top of the circle.
Depends on styled-components, but can be adapted for other frameworks.
<CurvedText
text="I'm curved"
@garth
garth / checkpoint.sh
Created December 22, 2016 15:45 — forked from phoob/checkpoint.sh
#!/bin/bash
#
# The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext
# which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just
# from time to time
# Usage: checkpoint.sh
# The script checks if Enpoint Security VPN is running. If it is, then it shuts it down, if it is not, it fires it up.
# Or, make an Automator action and paste the script.
# You will need sudo power, of course
#
@garth
garth / init.coffee
Last active May 17, 2018 09:02
Atom Settings
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@garth
garth / debounce.md
Last active March 16, 2016 20:26
cerebral-addons: calling debounce() without options has been temporarily deprecated.

before v0.6.x

The current default implementation of debounce is actually closer to throttle. We plan to transition the current behaviour to throttle, and change the deault behavour of debounce in the next major release.

Until version 0.6.x is released the following will give a deprecation warning:

signal('fieldChanged', [
@garth
garth / .eslintrc
Created January 2, 2016 13:17
.eslintrc for cerebral-snabbdom
{
"parser": "babel-eslint", // https://github.com/babel/babel-eslint
"env": {
"node": true
},
"globals": {},
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
@garth
garth / .bablerc
Created December 30, 2015 23:07
babel v6 setup
{
"presets": ["react", "es2015", "stage-1"],
"plugins": ["transform-decorators-legacy"],
"env": {
"development": {
"plugins": [
["react-transform", {
"transforms": [{
"transform": "react-transform-hmr",
"imports": ["react"],
@garth
garth / chaiCounter.js
Created November 16, 2015 09:23
A wrapper for chai that adds a count of the number times expect is called.
import { expect as chai } from 'chai';
let expected = null;
let actual = 0;
export default {
expect(target) {
actual++;
return chai(target);
@garth
garth / Grunt-HTMLBars.js
Last active August 29, 2015 14:11
Grunt task to pre-compile HTMLBars templates
'use strict';
var fs = require('fs');
var path = require('path');
var templateCompiler = require('./bower_components/ember/ember-template-compiler');
var templatesPath = 'templates'
module.exports = function (grunt) {
grunt.initConfig({
Ember.Handlebars.registerBoundHelper('render-dynamic', function (name, context, options) {
// name was passed as a variable, but should be passed to render as a string
options.types[0] = "STRING";
return Ember.Handlebars.helpers.render.call(this, name, context, options);
});