This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
server { | |
listen 443; | |
server_name example.com; | |
client_max_body_size 0; | |
chunkin on; | |
ssl on; | |
ssl_certificate /path/to/crt; | |
ssl_certificate_key /path/to/key; |
# Test completed with seige http://www.joedog.org/siege-home/ | |
# Test runs for 2 minutes, repeated 5 times | |
# siege --log=loadtest.log -H 'Content-Type:application/json' "https://qa01-sgp.bedegaming.net:18203/Auth/Login POST < ./postdata.json" -c 50 -t 2m | |
# postdata: {"Email": "[email protected]", "SiteCode": "bingostars.com", "Password": "xxxxx", "IpAddress": "127.0.0.1"} | |
# 50 concurrents | |
Date & Time Trans Elap Time Data Trans Resp Time Trans Rate Throughput Concurrent OKAY Failed | |
2013-11-12 10:06:18 3966 119.87 3 1.00 33.09 0.03 33.13 3966 0 | |
2013-11-12 10:08:32 3806 119.44 3 1.04 31.87 0.03 33.15 3806 0 |
require 'redcarpet' | |
# Custom handler that raises error. | |
# | |
module Redcarpet | |
module Render | |
class Crasher < HTML | |
def paragraph(text) | |
raise "Error!" | |
end |
FROM ubuntu | |
MAINTAINER Eric Mill "[email protected]" | |
# turn on universe packages | |
RUN echo "deb http://archive.ubuntu.com/ubuntu raring main universe" > /etc/apt/sources.list | |
RUN apt-get update | |
# basics | |
RUN apt-get install -y nginx openssh-server git-core openssh-client curl | |
RUN apt-get install -y nano |
getReferrerTraits = function() { | |
// Requires: jQuery, jQuery.cookie, segment.io | |
// TODO: Update referralHost:blackList with your domain, so we only track external referrers. | |
var analytics_args = [], | |
analytics_traits, | |
acquisitionSource, | |
firstReferrer, | |
firstCampaign, |
import requests | |
class HoverException(Exception): | |
pass | |
class HoverAPI(object): | |
def __init__(self, username, password): | |
params = {"username": username, "password": password} | |
r = requests.post("https://www.hover.com/api/login", params=params) |
sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'` | |
# or... | |
sudo killall coreaudiod |
# Depth-first search (DFS) is an algorithm for traversing or | |
# searching a tree, tree structure, or graph. One starts at | |
# the root (selecting some node as the root in the graph case) | |
# and explores as far as possible along each branch before backtracking. | |
# | |
# A graph can be represented by its adjacency matrix G, | |
# where G[i][j] == 1 if there is an edge between | |
# vertices i and j and 0 otherwise. | |
# | |
# Below Graph in diagram http://i.imgur.com/sV1UzUn.png |
In researching topics for RailsCasts I often read code in Rails and other gems. This is a great exercise to do. Not only will you pick up some coding tips, but it can help you better understand what makes code readable.
A common practice to organize code in gems is to divide it into modules. When this is done extensively I find it becomes very difficult to read. Before I explain further, a quick detour on instance_eval
.
You can find instance_eval
used in many DSLs: from routes to state machines. Here's an example from Thinking Sphinx.
class Article < ActiveRecord::Base