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
$primary-color: #1B1B1B; | |
$text-color: #333; | |
$link-color: #08C; | |
$current-menu-item-background: $primary-color; | |
$hover-menu-item-background: $primary-color; | |
$secondary-gradient-start: #F7F7F9; | |
$secondary-gradient-stop: #F7F7F9; |
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
# remove | |
/usr/libexec/PlistBuddy -c 'Add :LSUIElement bool true' /Applications/iTerm.app/Contents/Info.plist | |
# restore | |
/usr/libexec/PlistBuddy -c 'Delete :LSUIElement' /Applications/iTerm.app/Contents/Info.plist |
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 'rubygems' | |
require 'eventmachine' | |
module ChatClient | |
def self.list | |
@list ||= [] | |
end | |
def post_init | |
@name = "anonymous_#{rand(99999)}" |
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
# A sample Gemfile | |
source "http://rubygems.org" | |
gem "redis" | |
gem 'eventmachine', :git => 'git://github.com/eventmachine/eventmachine.git' | |
gem "em-hiredis" | |
# gem "em-synchrony" | |
gem "em-websocket" |
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
ffmpeg -i test.mp3 -vn -acodec libvorbis test.ogg |
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
# oj gem | |
gem 'oj' | |
gem 'oj_mimic_json' # we need this for Rails 4.1.x |
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
{ | |
"Id":"AllowPublicRead", | |
"Statement":[ | |
{ | |
"Sid":"AllowPublicRead", | |
"Action":[ | |
"s3:GetObject" | |
], | |
"Effect":"Allow", | |
"Resource":"arn:aws:s3:::your-bucket-name/*", |
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
# Reset processed counter | |
Sidekiq.redis { |c| c.del('stat:processed') } | |
# Reset failed counter | |
Sidekiq.redis { |c| c.del('stat:failed') } | |
# Reset all redis database with counters, history and current queues | |
Sidekiq.redis { |c| c.flushdb } |
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
-- This queries were tested on PostgreSQL 9.3.4 | |
-- Provides detailed information about servers current connections | |
SELECT datname as database, | |
pid, | |
user as username, | |
application_name as application, | |
client_addr as client_address, | |
query | |
FROM pg_stat_activity; |
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
-- Show biggest tables in your database | |
SELECT nspname || '.' || relname AS "relation", | |
pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size" | |
FROM pg_class C | |
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) | |
WHERE nspname NOT IN ('pg_catalog', 'information_schema') | |
AND C.relkind <> 'i' | |
AND nspname !~ '^pg_toast' | |
ORDER BY pg_total_relation_size(C.oid) DESC | |
LIMIT 20; |
OlderNewer