Skip to content

Instantly share code, notes, and snippets.

@isomorphisms
isomorphisms / tweetstrip.perl
Created September 14, 2011 07:49
grab the features out of tweets
#!/usr/bin/perl
use warnings; use strict;
use boolean;
use feature 'say';
#my $tweet = q{RT @peteyorn: @Starbucks Thanks for putting the Break Up album for sale in your stores. \\ It's a great album! Nice work!};
#my $tweet = q{@kohlgreyson Yesterday's announcement was just a preview. We will update the twitter icon in the spring.};
my $tweet = q{#StarbucksVIA is at Moonshine for the @Wired party for #SXSW. Two of our amazing designers are enjoying a VIAtini. http://yfrog.com/j59i1j};
@isomorphisms
isomorphisms / gist:1220207
Created September 15, 2011 19:21
How to identify spam on tumblr
init Score;
##### most telling features #######
Score += const * 10th_decile( vector_of_likes$Date );
Score += const * another_functional_of( vector_of_likes$Date );
Score += const * number of likes; #interaction term with % reblogs / number of written posts ... if the written posts start being hacked from somewhere else there are ways to identify that too
@isomorphisms
isomorphisms / fizzbuzz.perl
Created December 9, 2011 02:15
fizzbuzz. can I have a cookie now?
#!/usr/bin/perl
use warnings;
use strict;
use feature 'say';
for (my $i = 1; $i <= 100; $i++) {
if ($i % 15 == 0 ) { say "fizzbuzz"; }
elsif ($i % 3 == 0 ) { say "fizz"; }
elsif ($i % 5 == 0 ) { say "buzz"; }
@isomorphisms
isomorphisms / gist:1783240
Created February 9, 2012 21:08
How to generate patterned matrices in R and format then in LaTeX
> require(Hmisc)
> require(sfsmisc)
> k.3 <- matrix(
c(
-2, 1, 0,
-1, 2, -1,
0, -1, 2),
nrow=3, ncol=3
@isomorphisms
isomorphisms / .tmux.conf.bash
Created May 31, 2012 17:49
my tmux configuration
# You're meant to read through this
# configuraton file rather than simply
# copying it to your home directory.
#
# There are some places where you're
# meant to uncomment something if you
# want to use it in your TMUX.
#
# I hope it's readable.
#
@isomorphisms
isomorphisms / F11.R
Created June 26, 2012 08:33
the sporadic Janko group J1 in R #Rstats
F11 <- function(x) {
#numbers come in as floats
as.integer(x)
#error checking
stopifnot( is.integer(x) )
#struct
structure(x %% 11, class="F11")
}
@isomorphisms
isomorphisms / TTYtter.perl
Created July 27, 2012 09:38
TTYtter with /spam and /shoosh
#!/usr/bin/perl -s
#########################################################################
#
# TTYtter v2.0 (c)2007-2012 cameron kaiser (and contributors).
# all rights reserved.
# http://www.floodgap.com/software/ttytter/
#
# distributed under the floodgap free software license
# http://www.floodgap.com/software/ffsl/
#
@isomorphisms
isomorphisms / awful.html
Created July 30, 2012 19:03
my blog's awful css
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>{block:SearchPage}Search results for "{SearchQuery}" &bull; {/block:SearchPage}{block:PostSummary}{PostSummary} &bull; {/block:PostSummary} see things differently </title>
@isomorphisms
isomorphisms / .ttytterrc.pl
Created August 1, 2012 11:16
my .ttytterrc
vcheck=1
slowpost=2
ansi=1
ssl=1
dostream=1
newline=1
urlopen="w3m %U"
track='#Rstats #neo4j'
@isomorphisms
isomorphisms / significance.R
Last active December 11, 2015 17:09
magnitude (β) & significance (p) in regression analysis
par(col="#333333", lwd=3, pch=20, ylim=c(0,25), ylab="", xlab="",bty="n") #ylim,ylab,xlab won't run here; just reminders
#low β and confident in it
x <- runif(20,max=20)
y <- x + rnorm(20,0,.5)
plot(x,y, xlab="", ylab="", col=rgb(.1,.1,.5,.5), ylim=c(0,25), main="very confident (low p) and large response (high β)")
abline(coef(lm(y~x)), col="blue", lwd=2)
rug(x, col=rgb(.1,.1,.5)); rug(y, col=rgb(.1,.1,.5),side=2)