Skip to content

Instantly share code, notes, and snippets.

View automaticalldramatic's full-sized avatar
🪀
this is a useless feature

riz automaticalldramatic

🪀
this is a useless feature
View GitHub Profile

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

'use strict';
module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// configurable paths
var paths = {
@automaticalldramatic
automaticalldramatic / post-update
Created November 10, 2016 11:37 — forked from six0h/post-update
Git Post-Update hook that checks for changes to composer.lock, and fires a composer install if required.
#!/usr/bin/env python
#-*- coding: utf-8 -*-
"""A post-update Git hook to execute `composer install` when composer.json changes
:Author: Cody Halovich
:Company: HootSuite Media Inc.
"""
import subprocess
@automaticalldramatic
automaticalldramatic / class_decorator.ts
Created April 8, 2019 07:08 — forked from remojansen/class_decorator.ts
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@automaticalldramatic
automaticalldramatic / dump.go
Created July 19, 2019 08:54 — forked from ahmdrz/dump.go
Golang Reflection Example of an array.
package main
import (
"fmt"
"reflect"
)
type Test struct {
Name string
}
@automaticalldramatic
automaticalldramatic / 20140316-205912.go
Created July 19, 2019 08:54 — forked from ryochack/20140316-205912.go
golang reflection: interface of array
package main
import (
"fmt"
"reflect"
)
func dump_interface_array(args interface{}) {
val := reflect.ValueOf(args)
fmt.Println(val.Kind())
@automaticalldramatic
automaticalldramatic / channel_demo.go
Last active August 18, 2019 01:44 — forked from JensRantil/channel_demo.go
Simplification of sample code at https://blog.gopheracademy.com/advent-2015/automi-stream-processing-over-go-channels/ Best practise is 1) to inject channels and 2) avoid concurrency in APIs.
func ingest(out <-chan []string) {
out <- []string{"aaaa", "bbb"}
out <- []string{"cccccc", "dddddd"}
out <- []string{"e", "fffff", "g"}
close(out)
}
func process(in <-chan []string, out <-chan int) {
for data := range in {
for _, word := range data {
@automaticalldramatic
automaticalldramatic / golang-nuts.go
Last active September 3, 2019 11:39 — forked from ryanfitz/golang-nuts.go
two ways to call a function every 2 seconds
package main
import (
"fmt"
"time"
)
// Suggestions from golang-nuts
// http://play.golang.org/p/Ctg3_AQisl
@automaticalldramatic
automaticalldramatic / postgres-brew.md
Created November 11, 2019 22:38 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update