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:
var page = new WebPage(), | |
address, output, size; | |
if (phantom.args.length != 2) { | |
console.log('Give me URL and filename'); | |
phantom.exit(); | |
} else { | |
address = phantom.args[0]; | |
output = phantom.args[1]; | |
page.viewportSize = { width: 1024, height: 768 }; |
import os | |
import pty | |
pair = pty.fork() | |
if not pair[0]: | |
os.execvp('python', ['python']) | |
s = os.fdopen(pair[1], 'w+') | |
while True: |
def cbv_decorator(decorator): | |
""" | |
Turns a normal view decorator into a class-based-view decorator. | |
Usage: | |
@cbv_decorator(login_required) | |
class MyClassBasedView(View): | |
pass | |
""" |
if (!context.setup) { | |
context.setup = true; | |
var app = { | |
counts: { | |
GET: 0, | |
POST: 0, | |
}, | |
$log: $('<pre>').appendTo($(document.body)), | |
urls: [], |
class Tab | |
constructor: -> | |
@$tabs = ($ '.tab') | |
@$sections = ($ '.section') | |
@_idx = 0 | |
current_tab: => | |
@$tabs.eq(@_idx) | |
current_section: => |
class Accessor(object): | |
def __init__(self, wrapper, d): | |
self.wrapper = wrapper | |
self.d = d | |
def __repr__(self): | |
return repr(self.d) | |
def _get_failback(self, k): | |
chained = self.wrapper.chained |
<p> | |
<a href="http://cloudflare.com/email-protection.html#bcd7c5d3fcd4ddd5d08ec992d2d9c8"> | |
<span id="__cf_email__" class="4c2735230c242d25207e3962222938"> | |
[email protected] | |
</span> | |
<script type="text/javascript"> | |
/* <![CDATA[ */ | |
(function () { | |
try { | |
var s, a, i, j, r, c, l = document.getElementById("__cf_email__"); |
@mixin optimize-font-size($sizes) { | |
@each $r in $sizes { | |
$w: $safe-for-full * $r * $r; | |
@media (min-width: $w) { | |
font-size: percentage($r); | |
} | |
} | |
} |
# -*- coding: utf-8 -*- | |
import Image | |
def resize_and_crop(img_path, modified_path, size, crop_type='top'): | |
""" | |
Resize and crop an image to fit the specified size. | |
args: | |
img_path: path for the image to resize. |