Skip to content

Instantly share code, notes, and snippets.

View sshilko's full-sized avatar

Sergei sshilko

View GitHub Profile
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@ashleydw
ashleydw / PostProcess.php
Created October 18, 2011 09:04
Zend Framework Controller Plugin to allow post output processing
<?php
/**
* Zend Framework Controller Plugin to allow post output processing
*
* @version 1
* @author Ashley White, http://www.needathinkle.com/
* @license http://creativecommons.org/licenses/by-sa/3.0/
*/
final class Thinkle_Controller_Plugin_PostProcess extends Zend_Controller_Plugin_Abstract {
#! /usr/bin/env python
import fileinput
import argparse
from operator import itemgetter
parser = argparse.ArgumentParser()
parser.add_argument('--target-mb', action = 'store', dest = 'target_mb', default = 61000, type = int)
parser.add_argument('vmtouch_output_file', action = 'store', nargs = '+')
args = parser.parse_args()
@davidwkeith
davidwkeith / index.html
Last active May 28, 2024 07:25
NOTE: This was a great hack in days gone by, but now both Apple and Google have improved their support for custom protocol handlers. Licensed under the WFTPL http://www.wtfpl.net/txt/copying/
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>App Redirection</title>
</head>
<body>
<!--
NOTE: This was a great hack in days gone by, but now both Apple and Google have improved their support for custom
protocol handlers.
@gene1wood
gene1wood / transmission-daemon
Created February 26, 2013 18:16
Some simple logic to put the IP address of a specific interface into your /etc/sysconfig/transmission-daemon to get it to bind to that interface while issue https://trac.transmissionbt.com/ticket/2313 gets worked out. This applies to RHEL based installations.
# Username/password example
# DAEMON_ARGS="-b -t -a \"*.*.*.*\" -e /var/log/transmission/transmission.log"
# No username/password, but limited to 192.168.1.*
# DAEMON_ARGS="-b -T -a \"192.168.1.*\" -e /var/log/transmission/transmission.log"
INTERFACE=ppp0
if ifconfig $INTERFACE >>/dev/null 2>&1; then
BIND_ADDR="`/sbin/ifconfig $INTERFACE | awk '$1 == \"inet\" {print $2}' | awk -F: '{print $2}'`"
#!/bin/bash
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Mathias Leppich <mleppich@muhqu.de>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@todgru
todgru / aws-ec2-redis-cli.md
Created June 12, 2014 23:01
AWS redis-cli on EC2
@tuksik
tuksik / fix_git_ps1.sh
Last active May 4, 2024 13:56
Fix -bash: __git_ps1: command not found
#http://stackoverflow.com/questions/12870928/mac-bash-git-ps1-command-not-found
curl -o ~/.git-prompt.sh https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
echo 'source ~/.git-prompt.sh' >> ~/.bashrc
@ayosec
ayosec / UNIXBenchmarks-AWS-C4-C3.md
Last active May 9, 2017 15:30
AWS C3 vs C4: UNIX Benchmarks

BYTE UNIX Benchmarks

Summary

                                             c3.large           c4.large          c4 / c3
===========================================================================================
Dhrystone 2 using register variables       34752053.9 lps     43996767.0 lps       1.2660
Double-Precision Whetstone                     4459.8 MWIPS       8113.5 MWIPS     1.8193
Execl Throughput                               4110.8 lps         7697.1 lps       1.8724
@bgreenlee
bgreenlee / WiFiInfo.swift
Created November 7, 2015 23:05
Swift Class to encapsulate wifi network info
//
// WiFiInfo.swift
//
// Created by Brad Greenlee on 11/7/15.
//
import Foundation
import CoreWLAN
extension CWPHYMode: CustomStringConvertible {