#Mac OS X
This file contains hidden or 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
| CCA2 | Name | CCA3 | Nationality | |
|---|---|---|---|---|
| AD | Andorra | AND | Andorran | |
| AE | United Arab Emirates | ARE | Emirati | |
| AF | Afghanistan | AFG | Afghan | |
| AG | Antigua and Barbuda | ATG | Antiguan, Barbudan | |
| AI | Anguilla | AIA | Anguillian | |
| AL | Albania | ALB | Albanian | |
| AM | Armenia | ARM | Armenian | |
| AN | Netherlands Antilles | ANT | Dutch | |
| AO | Angola | AGO | Angolan |
This file contains hidden or 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 'mini_magick' | |
| class ImageResizer | |
| attr_accessor :height, :width, :padding, :stretch, :grayscale | |
| def initialize(path) | |
| @image = MiniMagick::Image.open(path) | |
| end |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
This file contains hidden or 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
| # config/initializers/devise.rb | |
| # | |
| # We now ask Warden to use :vip_authenticatable when authenticating. | |
| # | |
| # Also, we instruct Warden to load User from session without any default scoping. | |
| # | |
| Devise.setup do |config| | |
| config.warden do |manager| | |
| require Rails.root+'lib/vip_authenticable' | |
| manager.default_strategies(scope: :user).unshift :vip_authenticatable |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| $server = 'irc.stripe.com' | |
| $channel = '#level8' | |
| $nick = 'FlagBot' | |
| $chanfile = '~/.xchat2/xchatlogs/NETWORK-\#level8.log' | |
| $sshpath = '[email protected]' | |
| $command = 'ruby bot.rb' | |
| $store = './flags.rb' |
This file contains hidden or 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($) { | |
| function parseImagesFromCSS(doc) { | |
| var i, j, | |
| rule, | |
| image, | |
| pattern = /url\((.*)\)/, | |
| properties = ['background-image', '-webkit-border-image'], | |
| images = {}; | |
| if (doc.styleSheets) { |
This file contains hidden or 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 'rubygems' | |
| require "mongo_mapper" | |
| regex_match = /.*:\/\/(.*):(.*)@(.*):(.*)\//.match(ENV['MONGOLAB_URI']) | |
| host = regex_match[3] | |
| port = regex_match[4] | |
| db_name = regex_match[1] | |
| pw = regex_match[2] | |
| MongoMapper.connection = Mongo::Connection.new(host, port) |
This file contains hidden or 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
| check process redis-server | |
| with pidfile "/var/run/redis.pid" | |
| start program = "/etc/init.d/redis-server start" | |
| stop program = "/etc/init.d/redis-server stop" | |
| if 2 restarts within 3 cycles then timeout | |
| if totalmem > 100 Mb then alert | |
| if children > 255 for 5 cycles then stop | |
| if cpu usage > 95% for 3 cycles then restart | |
| if failed host 127.0.0.1 port 6379 then restart | |
| if 5 restarts within 5 cycles then timeout |
This file contains hidden or 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
| Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X) | |
| (if you aren't using version 9.1.5, change line 6 with the correct version) | |
| 1. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
| 2. mv /usr/local/var/postgres /usr/local/var/postgres91 | |
| 3. brew update | |
| 4. brew upgrade postgresql | |
| 5. initdb /usr/local/var/postgres -E utf8 | |
| 6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres | |
| 7. cp /usr/local/Cellar/postgresql/9.2.0/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/ |