Skip to content

Instantly share code, notes, and snippets.

@n1k0
n1k0 / quickstart.coffee
Created November 13, 2011 12:12
CasperJS documentation examples
phantom.injectJs "casper.js"
getLinks = ->
links = document.querySelectorAll "h3.r a"
Array::map.call links, (e) -> e.getAttribute "href"
links = []
casper = new phantom.Casper()
casper.start "http://google.fr/", (self) ->
@sgmurphy
sgmurphy / podcast-ratings.php
Created February 21, 2012 19:31
Scrape ratings from iTunes store
<?php
/**
* Scrape the number of podcast reviews from iTunes for all country specific storefronts.
*
* @author Sean Murphy <[email protected]>
*/
$podcast_id = '366931951'; // Startups For the Rest of Us
//$podcast_id = '318567721'; // techzing
@jrochkind
jrochkind / gist:2636355
Created May 8, 2012 15:31
reddit 'hot' algorithm, in ruby, with typo fixed
require 'date'
# Actually doesn't matter WHAT you choose as the epoch, it
# won't change the algorithm. Just don't change it after you
# have cached computed scores. Choose something before your first
# post to avoid annoying negative numbers. Choose something close
# to your first post to keep the numbers smaller. This is, I think,
# reddit's own epoch.
$our_epoch = Time.local(2005, 12, 8, 7, 46, 43).to_time
@kentbye
kentbye / app-store-ratings.php
Created September 17, 2012 23:15 — forked from sgmurphy/podcast-ratings.php
Scrape iOS app review data from iTunes
<?php
/**
* Scrape the number of app reviews from iTunes.
*
* Set the iOS app id and the number of pages to scrape, and it creates a {$app_id}-reviews.csv file
*
* @author Kent Bye <[email protected]>
* Modified and extended from Sean Murphy's gist at https://gist.github.com/1878352
*/
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active November 5, 2024 18:44
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@passy
passy / jade.md
Last active August 17, 2020 09:35
Using Yeoman and Jade

Using Yeoman and Jade

Getting started

  • Make sure you have yo installed: npm install -g yo
  • Run: yo webapp
  • Install grunt-contrib-jade: npm install grunt-contrib-jade --save-dev

Customization

@adamphillips
adamphillips / benchmark_url
Last active May 29, 2019 10:48
A quick and dirty url benchmarking script. Needs a chmod +x. Alternatively just run it with ruby
#!/usr/bin/env ruby
# Used to perform multiple requests of urls for benchmarking
#
# @example
# # Requests the url 3 times outputting times for each
# ./benchmark_url 3 http://my.url.com
# ruby benchmark_url 3 http://my.url.com
#
# # Requests each url 5 times outputting times for each
@dustingetz
dustingetz / SwitchBox.js
Last active September 15, 2016 08:38
SwitchBox react control for a checkbox with special designer markup to look like a lightswitch
/** @jsx React.DOM */
define([
'underscore', 'jquery', 'react', 'platform/uuid'
], function (_, $, React, uuid) {
'use strict';
/**
* SwitchBox control (checkbox with special markup to look like a light switch).
* Can be configured with an optional `onChange` prop to effect state up the tree.
*/
angular.module('restangularDemoApp', [
'restangular',
'ngCookies'
])
.constant('apiKey', 'YOUR_Mongolab_API_KEY')
.config(function(RestangularProvider, apiKey) {
RestangularProvider.setBaseUrl('https://api.mongolab.com/api/1/databases/YOURDATABASE/collections');
RestangularProvider.setDefaultRequestParams({
apiKey: apiKey
})
@booleanbetrayal
booleanbetrayal / Gruntfile.js
Last active November 9, 2023 18:59
Example GruntJS configuration for a replacement to the Sprockets Rails asset pipeline
'use strict';
module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// configurable paths
var paths = {