Skip to content

Instantly share code, notes, and snippets.

View Dottenpixel's full-sized avatar

dugg molidor Dottenpixel

View GitHub Profile
@Dottenpixel
Dottenpixel / gist:1161365
Created August 22, 2011 00:01
Flowplayer : Dynamically set cuepoints to fire an event at certain points in Clip's play progress
$f("", {},
{
clip: {
onMetaData: function(c) {
var fd = c.duration;
//create a cue point for 25, 50 and 75% of player progress
var cues = [
{
time: fd * .25 * c.cuepointMultiplier,
name: "25%"
@Dottenpixel
Dottenpixel / gist:2852948
Created June 1, 2012 15:26
Example Credit Card Numbers for User testing of credit card fields
American Express 3400 0000 0000 009
Carte Blanche 3000 0000 0000 04
Discover 6011 0000 0000 0004
Diner's Club 3000 0000 0000 04
enRoute 2014 0000 0000 009
JCB 2131 0000 0000 0008
MasterCard 5500 0000 0000 0004
Solo 6334 0000 0000 0004
Switch 4903 0100 0000 0009
Visa 4111 1111 1111 1111
@Dottenpixel
Dottenpixel / gist:2867770
Created June 4, 2012 11:13
Ruby number filtering
#Find all 4-digit numbers that contain 1,2,3 or 4
(1111..4444).to_a.find_all{|n| n.to_s =~ /[1-4]{4}/}
@Dottenpixel
Dottenpixel / gist:3086273
Created July 10, 2012 21:15
RegEx that reliably tests for a valid URL
/^((http|https|ftp):\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/ix
<?php
require("postmark.php");
$postmark = new Postmark("your-api-key","from-email","optional-reply-to-address");
$result = $postmark->to("[email protected]")
->subject("Email Subject")
->plain_message("This is a plain text message.")
->attachment('File.pdf', $file_as_string, 'application/pdf')
@Dottenpixel
Dottenpixel / gist:5777922
Created June 13, 2013 22:26
RegExp Negation Example
str = "(San Francisco, CA), (San Jose, CA), Palo Alto, Cupertino, (Mountain View, CA)";
//> "(San Francisco, CA), (San Jose, CA), Palo Alto, Cupertino, (Mountain View, CA)"
str.split(/\s*,\s*(?![\w\s]*\))/)
//> ["(San Francisco, CA)", "(San Jose, CA)", "Palo Alto", "Cupertino", "(Mountain View, CA)"]
@Dottenpixel
Dottenpixel / gist:6180983
Created August 8, 2013 02:39
Output Ruby Object to symbolized Hash
raw JSON.parse(@my_object.to_json, :symbolize_names => true)
@Dottenpixel
Dottenpixel / gist:6789319
Created October 2, 2013 05:01
gem list for rvm 2.0.0@refinery
actionmailer (3.2.14)
actionpack (3.2.14)
activemodel (3.2.14)
activerecord (3.2.14)
activeresource (3.2.14)
activesupport (3.2.14)
acts_as_indexed (0.8.3)
arel (3.0.2)
awesome_nested_set (2.1.6)
awesome_print (1.1.0)
# install dependencies
sudo apt-get install libcurl4-openssl-dev libncurses5-dev pkg-config automake yasm git
# clone cpuminer
git clone https://github.com/pooler/cpuminer.git
# compile
cd cpuminer
./autogen.sh
./configure CFLAGS="-O3"
@Dottenpixel
Dottenpixel / gist:9756464
Last active August 29, 2015 13:57
Useful tip to fix permissions from Homebrew/legacy-homebrew#10292
#From Homebrew/homebrew#10292 https://github.com/Homebrew/homebrew/issues/10292
chown -R $(whoami) /usr/local/.git