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
var writeData = function (filename, data, callback) { | |
var writeOutData = function () { | |
var fw = new FileWriter(); | |
fw.oncomplete = callback; | |
fw.onerror = function () { | |
alert("Failed to save update"); | |
} | |
fw.writeAsText("myDir/" + filename, data); | |
} | |
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
require 'rake' | |
# http://ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTP.html | |
require 'net/http' | |
desc "this is a test" | |
task :testing_rake do | |
puts "Hello from rake!" | |
end | |
namespace :remote_file do |
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 | |
alias g="git" | |
# If your branch named like [issue_number]_some_description | |
gh_issue() { | |
ghissue=`echo $(current_branch) | sed -e 's/\([0-9]*\).*/\1/'` | |
if [ $ghissue ]; then | |
echo "$ghissue" | |
fi | |
} |
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
# Path to your oh-my-zsh configuration. | |
export ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="aussiegeek" | |
# Example aliases |
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
/ip dns static add address=127.0.0.1 ttl=600w name=".*\\.vk\\.com" | |
/ip dns static add address=127.0.0.1 ttl=600w name="rs.mailer.ru" | |
/ip dns static add address=127.0.0.1 ttl=600w name="googleads.g.doubleclick.net" | |
/ip dns static add address=127.0.0.1 ttl=600w name="pagead2.googlesyndication.com" | |
/ip dns static add address=127.0.0.1 ttl=600w name="www.googletagservices.com" | |
/ip dns static add address=127.0.0.1 ttl=600w name="a.pr.dotua.org" | |
/ip dns static add address=127.0.0.1 ttl=600w name="google-analytics.com" | |
/ip dns static add address=127.0.0.1 ttl=600w name=".*\\.google-analytics\\.com" | |
/ip dns static add address=127.0.0.1 ttl=600w name="mc.yandex.ru" | |
/ip dns static add address=127.0.0.1 ttl=600w name="share.yandex.ru" |
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
// Traverses an arbitrary struct and translates all stings it encounters | |
// | |
// I haven't seen an example for reflection traversing an arbitrary struct, so | |
// I want to share this with you. If you encounter any bugs or want to see | |
// another example please comment. | |
// | |
// The MIT License (MIT) | |
// | |
// Copyright (c) 2014 Heye Vöcking | |
// |
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
require 'optparse' | |
require 'yaml' | |
require 'base64' | |
options = { | |
config_path: File.join(ENV['HOME'], '.kube', 'config'), | |
write_dir: File.join(ENV['HOME'], '.kube') | |
} | |
OptionParser.new do |opts| |
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
#!/bin/bash | |
# Input: ./extract_kubecfg_cert.sh my-cluster-name username | |
# Output: ./my-cluster-name-ca.crt ./username.crt ./username.key | |
# Exit on error | |
abort(){ | |
echo $1 && exit 1 | |
} | |
# Prerequistes |
OlderNewer