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;
}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') + ']' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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']; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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" { |
- Log in to console for
root
account as your IAM username@example.com
- Go to https://console.aws.amazon.com/iam/home
- Add an MFA device to your user
- Generate an access key and store it securely to be added to aws-vault
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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 > |
OlderNewer