Skip to content

Instantly share code, notes, and snippets.

View Gowiem's full-sized avatar
🌤️
Stoked on Terraforming

Matt Gowie Gowiem

🌤️
Stoked on Terraforming
View GitHub Profile
@bigjason
bigjason / syntax_highlighting.py
Created September 22, 2011 22:38 — forked from mstarkman/syntax_highlighting.py
Ruby on Rails syntax highlight switcher for Sublime Text 2
import os
from fnmatch import fnmatch
import sublime, sublime_plugin
class DetectFileTypeCommand(sublime_plugin.EventListener):
"""
Detects current file type if the file's extension isn't
Modified for Ruby on Rails and Sublime Text 2 Original pastie
here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa
(function (global) {
"use strict";
function empty(obj) {
var key;
for (key in obj) if (obj.hasOwnProperty(key)) return false;
return true;
}
var Ember = global.Ember,
@ramybenaroya
ramybenaroya / recursive.js
Created February 23, 2015 13:18
Ember Data Recursive Transform
// app/transforms/recursive.js
export default DS.Transform.extend({
deserializeRecursively: function(toTraverse) {
var hash;
if (Ember.isArray(toTraverse)) {
return Ember.A(toTraverse.map(function(item) {
return this.deserializeRecursively(item);
}, this));
} else if (!Ember.$.isPlainObject(toTraverse)) {
def colorize(text, color_code)
"\e[#{color_code}m#{text}\e[0m"
end
def red(text); colorize(text, 31); end
def green(text); colorize(text, 32); end
# Actual example
#puts 'Importing categories [ ' + green('DONE') + ' ]'
#puts 'Importing tags [' + red('FAILED') + ']'
@mehulkar
mehulkar / gist:3232255
Created August 2, 2012 01:22
Flatten DS.ManyArray in Ember

Flatten a DS.ManyArray in Ember.js

Ember.ArrayProxy.prototype.flatten = Array.prototype.flatten = function() {
  var r = [];
  this.forEach(function(el) {
    r.push.apply(r, Ember.isArray(el)  ? el.flatten() : [el]);
  });
  return r;
}
@stucox
stucox / mutationobserver.js
Created March 24, 2013 09:36
Mutation Observer feature detection
// http://www.w3.org/TR/dom/
// http://updates.html5rocks.com/2012/02/Detect-DOM-changes-with-Mutation-Observers
// https://developer.mozilla.org/en-US/docs/DOM/MutationObserver
var MutationObserver = (function () {
var prefixes = ['WebKit', 'Moz', 'O', 'Ms', '']
for(var i=0; i < prefixes.length; i++) {
if(prefixes[i] + 'MutationObserver' in window) {
return window[prefixes[i] + 'MutationObserver'];
}
}
@afmsavage
afmsavage / settings.json
Created May 8, 2020 02:09
Extensions List and my settings.json from VSCode
{
"git.autofetch": true,
"git.confirmSync": false,
"terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
"vs-kubernetes": {
"vs-kubernetes.helm-path": "/home/pants/.vs-kubernetes/tools/helm/linux-amd64/helm",
"vs-kubernetes.minikube-path": "/home/pants/.vs-kubernetes/tools/minikube/linux-amd64/minikube",
"vs-kubernetes.draft-path": "/home/pants/.vs-kubernetes/tools/draft/linux-amd64/draft",
"vs-kubernetes.draft-path.linux": "/home/tony/.vs-kubernetes/tools/draft/linux-amd64/draft",
@RothAndrew
RothAndrew / gitlab_set_personal_access_token.tf
Last active September 24, 2020 21:32
Idempotently create a Personal Access Token for a user in GitLab running in Kubernetes
// WARNING: Don’t mess with gitlab-rails runner unless you REALLY know what you are doing.
// It gives root-level access to EVERYTHING at the database level.
// Idempotently create a Personal Access Token for a user in GitLab running in Kubernetes
// USE AT YOUR OWN RISK
resource "null_resource" "set_gitlab_personal_access_token" {
triggers = {
uuid = uuid()
}
provisioner "local-exec" {

Notes on using Geodesic with repos created by cloudposse/reference-architectures

How to Use this Repo

AWS Setup

  1. Log in to console for root account as your IAM user name@example.com
  2. Go to https://console.aws.amazon.com/iam/home
  3. Add an MFA device to your user
  4. Generate an access key and store it securely to be added to aws-vault
@nathanpc
nathanpc / phonegap_download_example.html
Created April 22, 2012 13:11
Sample code to download file from internet - Phonegap Wiki
<!DOCTYPE html>
<html>
<head>
<title></title>
<!-- Android
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta charset="utf-8">-->
<!-- iPad/iPhone specific css below, add after your main css >