View Vagrantfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$script = <<SCRIPT | |
set -e | |
set -x | |
cd | |
sudo apt-get update -y | |
sudo apt-get install \ |
View SketchSystems.spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Image Modifier | |
Specify Preview Image* | |
Empty URL* | |
typed -> Filled URL | |
Filled URL | |
submitted -> Select Ad Format | |
Select Ad Format | |
selected Single -> Single | |
selected Carousel -> Carousel | |
Carousel* |
View capture_screenshot.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var casper = require('casper').create({ | |
viewportSize: {width: 950, height: 950} | |
}); | |
casper.start('http://www.google.com/', function() { | |
this.captureSelector('/tmp/pp.png', 'body'); | |
}); | |
casper.run(); |
View celluloid_pool.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'celluloid' | |
require "benchmark" | |
require 'open-uri' | |
delay_seconds = [4,4,4,4,4,4] | |
BASE_URL = "http://slowapi.com/delay" | |
class Crawler | |
include Celluloid | |
def read(delay) |
View static_server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs"), | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { |
View mamp_function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mamp() { | |
# | |
# Default location of the apache conf file for MAMP | |
CONF_FILE="/Applications/MAMP/conf/apache/httpd.conf" | |
# | |
# Fish existing doc root out of conf file | |
LINE=$(cat $CONF_FILE | grep "^DocumentRoot") | |
QUOTED_STRING=${LINE/DocumentRoot /} | |
OLD_DOC_ROOT=${QUOTED_STRING//\"/} | |
# |
View hide_payment-gateway_unless_customer_has_tag.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PAYMENT_GATEWAY_NAME = 'Invoice' | |
CUSTOMER_TAG = 'VIP' | |
customer = Input.cart.customer | |
remove_gateway = (customer.nil? or !customer.tags.include?(CUSTOMER_TAG)) | |
if remove_gateway | |
Output.payment_gateways = Input.payment_gateways.delete_if do |payment_gateway| | |
payment_gateway.name == PAYMENT_GATEWAY_NAME | |
end |
View miner.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'digest/sha1' | |
@ctf_username = "user-8lmmcgvw" | |
def addToLedger | |
user_in_ledger = false | |
File.open("LEDGER.txt").each_line do |line| | |
if line.match(/^#{@ctf_username}:/) | |
user_in_ledger = true | |
end |
View gravatar.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get the url of an emails gravatar image | |
# | |
# default_image can either be an image url or one of the following: mm, identicon, monsterid, wavatar, retro, blank | |
# (See https://de.gravatar.com/site/implement/images/ for all options) | |
# | |
# Example usage: | |
# get_gravatar_image_url("example@example.com", 80, "retro") | |
get_gravatar_image_url = (hashed_email, size=80, default_image="mm", force_default=false) -> | |
size = (if (size >= 1 and size <= 2048) then size else 80) |
View export_addressbook_to_snom.scpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Addressbook to SNOM export | |
-- Be sure to open Contacts app before running this script | |
set resultText to "" | |
set currentLine to "" | |
set numPhones to 0 | |
tell application id "com.apple.AddressBook" | |
set the clipboard to people's vcard | |
-- Find the maximum number of phone numbers | |
repeat with x from 1 to the count of people |