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:
| # config/environments/production.rb: | |
| config.action_controller.asset_host = "http://cdn%d.example.com" | |
| # config/initializers/refinery/images.rb: | |
| config.dragonfly_url_format = "/images/:job/:basename.:ext" | |
| if Rails.env.production? | |
| config.dragonfly_url_host = "http://cdn4.example.com" | |
| end | |
| # config/initializers/refinery/resources.rb: |
| require 'fiddle' | |
| module Python | |
| def __class__= k | |
| value = _wrap self | |
| [k.object_id<<1].pack('Q').unpack('C8').each_with_index {|n,i|value[i+8]=n} | |
| end | |
| def _wrap klass; Fiddle::Pointer.new Fiddle.dlwrap klass; end | |
| end |
| # Builder file for sentry | |
| # | |
| FROM ubuntu | |
| MAINTAINER Michael Crosby | |
| RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list | |
| RUN apt-get update | |
| RUN apt-get upgrade |
| #!/bin/bash | |
| sudo apt-get update | |
| # Now let's install all the required ubuntu packages | |
| sudo apt-get install build-essential uwsgi nginx uwsgi-plugin-python python-pip | |
| # PS! If you are doing this stuff for fun I do recommend to install nginx from PPA repository | |
| # that you can find here https://launchpad.net/~nginx/+archive/development |
| /* | |
| * Copyright (c) 2017 Emil Davtyan | |
| * | |
| * 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 copies of the Software, and to | |
| * permit persons to whom the Software is furnished to do so, subject to | |
| * the following conditions: |
| #!/usr/bin/env ruby | |
| # | |
| # Proof-of-Concept exploit for Rails Remote Code Execution (CVE-2013-0156) | |
| # | |
| # ## Advisory | |
| # | |
| # https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion | |
| # | |
| # ## Caveats | |
| # |
| PROGRAM := llvm-brainfuck | |
| OBJECTS := main.o | |
| SHIM := shim.a | |
| SHIM_OBJECTS := shim.o | |
| CC := clang | |
| CXX := clang++ | |
| CXXFLAGS := $(shell llvm-config --cppflags) -Wall -Werror -pedantic | |
| LDFLAGS := $(shell llvm-config --ldflags --libs core) |
| # | |
| # Uncrustify Configuration File | |
| # File Created With UncrustifyX 0.2 (140) | |
| # | |
| # Alignment | |
| # --------- | |
| ## Alignment |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.