#List of countries
It's time someone compiled a list of countries to use within a web application. This gist attempts to make a first move at that.
I've also compiled a list of nationalities
# This hook depends on helm creating the target namespace if it doesn't exist | |
# before the hook is called. This is the case on Helm v2.9.1 | |
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
name: label-ns | |
namespace: cicd | |
labels: | |
release: {{ .Release.Name }} | |
heritage: {{ .Release.Service }} |
# 1) Create your private key (any password will do, we remove it below) | |
$ cd ~/.ssh | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
### | |
Pokemon Go(c) MITM node proxy | |
by Michael Strassburger <[email protected]> | |
This example just dumps all in-/outgoing messages and responses | |
### | |
PokemonGoMITM = require './lib/pokemon-go-mitm' |
# uber-hacky dynamic collection names for MongoID models: | |
# | |
# class MyModel | |
# include Mongoid::PrefixableDocument # ...instead of Mongoid::Document | |
# include Mongoid::Timestamps | |
# | |
# field :foobar, :type => Integer | |
# | |
# def my_method; 123; end | |
# |
If you want to use multiple dbs at once there are several different ways... | |
1) If you want to do this on a per-model level, use .store_in (This is for all threads): | |
class Band | |
include Mongoid::Document | |
store_in database: "secondary" # This can be any name you want, no need to put it in the mongoid.yml. | |
end | |
class Artist |
# migrate all images to S3 | |
namespace :paperclip_migration do | |
desc "migrate files from filesystem to s3" | |
task :migrate_to_s3 => :environment do | |
local_filesystem_root = Rails.root.to_s + "/public/system" | |
# Fetch all models and find out which ones have paperclip attachments | |
Rails.application.eager_load! | |
models = ActiveRecord::Base.send(:descendants).select {|model| model.respond_to?(:attachment_definitions) } |
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
# By Steve Leung | |
# [email protected] | |
class ActiveRecord::Relation | |
# temporarily hack for allowing combining scopes with OR | |
# doesn't add the join tables so need to use .includes manually | |
# ie. Jobship.includes(:job).or(Jobship.accepted, Jobship.declined).count | |
def or(*scopes) | |
clauses = *scopes.map do |relation| |
#List of countries
It's time someone compiled a list of countries to use within a web application. This gist attempts to make a first move at that.
I've also compiled a list of nationalities
Just follow these steps: | |
cd Library/Application Support/Sublime\ Text\ 2/Packages/ ## go to your own directory of sublime | |
git clone git://github.com/cucumber/cucumber-tmbundle.git Cucumber | |
cd Cucumber/Syntaxes/ | |
rm Cucumber\ Plain\ Text\ Feature.tmLanguage | |
wget https://raw.github.com/gist/864839/8752ef038ecaab8c9f3174b6ec419ed6f391e0c3/Cucumber%20Plain%20Text%20Feature.tmLanguage | |
Restart Sublime Text 2. | |
Then choose view->syntax->cucumber->cucumber steps. |