Skip to content

Instantly share code, notes, and snippets.

@Niteshvgupta
Niteshvgupta / readme.md
Last active March 1, 2023 02:15
Install PHP7-compatible memcache on Mac OS X

1. Install PHP7 with brew

brew install php70

2. Install Memcache from source on PHP7 branch

git clone -b NON_BLOCKING_IO_php7 https://github.com/websupport-sk/pecl-memcache.git
cd pecl-memcache
phpize
./configure
make && make install
@omnibs
omnibs / phoenix showdown rackspace onmetal io.md
Last active January 25, 2023 18:33
Phoenix Showdown Comparative Benchmarks @ Rackspace

Comparative Benchmark Numbers @ Rackspace

I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.

Results

Framework Throughput (req/s) Latency (ms) Consistency (σ ms)
var active = false;
function changeRefer(details) {
if (!active) return;
for (var i = 0; i < details.requestHeaders.length; ++i) {
if (details.requestHeaders[i].name === 'Referer') {
details.requestHeaders[i].value = 'http://www.google.com/';
break;
}
@Geesu
Geesu / assets.rake
Created December 8, 2014 16:55
Disable asset precompilation on heroku
Rake::Task["assets:precompile"].clear
namespace :assets do
task 'precompile' do
puts "Not pre-compiling assets..."
end
end
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@mxcl
mxcl / uninstall_homebrew.sh
Created August 26, 2011 11:25
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@zenchild
zenchild / delegate_access.rb
Created August 18, 2011 02:41
Getting delegate access to another users Exchange folder in Viewpoint
require 'json'
require 'viewpoint'
include Viewpoint::EWS
puts "Usage: cal_items.rb <email>" if ARGV.length == 0
email = ARGV[0]
cfile="creds_test.json"
creds = JSON.load(File.open(cfile,'r'))
Viewpoint::EWS::EWS.endpoint = creds['endpoint']
Viewpoint::EWS::EWS.set_auth(creds['user'],creds['pass'])
cal = GenericFolder.get_folder(:calendar, email)
@stream7
stream7 / migration_integer_limit_option
Created July 7, 2011 14:09
Rails migrations integer :limit option
literally always have to look up the meaning of :limit in migrations when it comes to integer values. Here's an overview. Now let's memorise it (oh, this works for MySQL, other databases may work differently):
:limit Numeric Type Column Size Max value
1 tinyint 1 byte 127
2 smallint 2 bytes 32767
3 mediumint 3 byte 8388607
nil, 4, 11 int(11) 4 byte 2147483647
5..8 bigint 8 byte 9223372036854775807
Note: by default MySQL uses signed integers and Rails has no way (that I know of) to change this behaviour. Subsequently, the max. values noted are for signed integers.