After installing the keybase command-line tool onto a new / fresh computer, you may want to import your PGP key to the local keyring so that you may use the keys with GPG.
Import your PUBLIC PGP key:
keybase pgp export|gpg --import -
After installing the keybase command-line tool onto a new / fresh computer, you may want to import your PGP key to the local keyring so that you may use the keys with GPG.
Import your PUBLIC PGP key:
keybase pgp export|gpg --import -
# Search term parser from https://gist.github.com/1477730 | |
# Modified to allow periods (and other non-letter chars) in unquoted field values | |
# and field names. | |
# | |
# Helper class to help parse out more advanced saerch terms | |
# from a form query | |
# | |
# Note: all hash keys are downcased, so ID:10 == {'id' => 10} | |
# you can also access all keys with methods e.g.: terms.id = terms['id'] = 10 | |
# this doesn't work with query as thats reserved for the left-over pieces |
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.
I hereby claim:
To claim this, I am signing this object:
trait ReflectionSugars{ | |
import scala.reflect.runtime.{universe => ru} | |
private lazy val universeMirror = ru.runtimeMirror(getClass.getClassLoader) | |
def companionOf[T](implicit tt: ru.TypeTag[T]) = { | |
val companionMirror = universeMirror.reflectModule(ru.typeOf[T].typeSymbol.companionSymbol.asModule) | |
companionMirror.instance | |
} | |
} |
@echo off | |
SET st2Path=C:\Program Files\Sublime Text 2\sublime_text.exe | |
rem add it for all file types | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f | |
rem add it for folders | |
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f |
require 'typhoeus' | |
require 'nokogiri' | |
require 'uri' | |
Typhoeus::Config.verbose = true | |
response = Typhoeus.get("http://wallbase.cc/toplist/index/?ts=1", headers: { 'X-Requested-With' => 'XMLHttpRequest' }) | |
def download_wallpaper(wallpaper_url) | |
puts "Downloading #{wallpaper_url}" |
# Copy my ssh public key to the server | |
ssh-copy-id root@<ip> | |
# Log into server | |
ssh root@<ip> | |
# Create new user | |
adduser app | |
usermod -a -G sudo app | |
su - app |
class MSoc { | |
committee President; | |
committee Vice_President; | |
committee Secretary; | |
committee Treasurer; | |
committee Communications_Secretary; | |
committee Sports_Secretary; | |
committee Committee_Members[4]; | |
}; |
# -------------------------------------------- | |
# General | |
# -------------------------------------------- | |
set :shared_children, %w(cache logs) # Shared directories, these directories contain generated content which should not be wiped out during deployments. | |
set :application, "domain.com" # Application name | |
set :deploy_to, "/var/www/#{application}/#{stage}" # Path where files are deployed to ... | |
# -------------------------------------------- | |
# Server | |
# -------------------------------------------- |