Skip to content

Instantly share code, notes, and snippets.

View Demeter's full-sized avatar

demeter Demeter

  • Phoenix Arizona
  • 22:40 (UTC -07:00)
View GitHub Profile
@jaredwoodard
jaredwoodard / CBOE_csv_to_xts
Created October 19, 2012 01:57
pulls csv files from the CBOE and converts them to xts
library("quantmod")
# we're pulling the Google VIX index (VXGOG) but this also works for VXAPL, VXGS etc.
# see http://www.cboe.com/micro/equityvix/introduction.aspx
url <- "http://www.cboe.com/publish/ScheduledTask/mktdata/datahouse/VXGOGDailyPrices.csv"
symb = read.csv(url,header=FALSE, stringsAsFactors=F)
symb <- symb[-1,]
colnames(symb) <- c(symb[1,])
symb <- symb[-1,]
@LeFreq
LeFreq / Python3000
Last active October 11, 2015 07:58
The real Python 3000
This is a start for an examination of Python and its evolution. More specifically, it looks at the issue of what was called Python3000 (Python3k) and how well the release of Python3 lived up to its hopes and vision. (For more detail see Ward's Wiki at the WikiWikiWeb).
I think many have not migrated over to python3 because there was a feeling of being let down with the possibilities of re-structuring Python for its famed 3000 release. This gist is a place holder for all issues that I know relating to a fully satisfying Python 3000 that keeps to the spirit of the Python community and continues the path of elegance.
Without knowing, Python (and the computer programming domain, in general) has been evolving into a Unified Information Model. In hindsight, this seems a natural trajectory within the field of Computer Science towards simplification of data handling and ease of use. Elegance has become the keyword for programmers in the Programming and Open Source community and I think Python is the language w
@joyita
joyita / gist:3736164
Created September 17, 2012 08:24
PhraseTokensier
package uk.co.fues.submission.classifier.nlp;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import opennlp.tools.cmdline.parser.ParserTool;
import opennlp.tools.parser.Parse;
@joyita
joyita / gist:3610899
Created September 3, 2012 17:07
Parsing spam
private static Set<String> removeRepeatedSentances(String text) {
String [] paras = text.split("\n+");
List<String> paragraphs = Arrays.asList(paras);
for(int i = 0; i<paragraphs.size(); i++) {
String paragraph = paragraphs.get(i);
paragraphs.set(i, clearWhitespace(paragraph));
}
Set<String> ret = new HashSet<String>();
for(String para:paragraphs) {
ret.add(para);
(def rand-string (n)
(let c "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
(with (nc 62 s (newstring n) i 0)
(w/infile str "/dev/urandom"
(while (< i n)
(let x (readb str)
(unless (> x 247)
(= (s i) (c (mod x nc)))
(++ i)))))
s)))
@schlamar
schlamar / gist:2993700
Last active September 23, 2016 20:55
urllib2 HTTPS connection with proxy and cert verification
import httplib
import urllib2
import ssl
import certifi
from backports.ssl_match_hostname import match_hostname
class CertValidatingHTTPSConnection(httplib.HTTPConnection):
default_port = httplib.HTTPS_PORT
@paulmillr
paulmillr / active.md
Last active April 24, 2025 10:07
Most active GitHub users (by contributions). https://paulmillr.com

Most active GitHub users (git.io/top)

The list would not be updated for now. Don't write comments.

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Because of GitHub search limitations, only 1000 first users according to amount of followers are included. If you are not in the list you don't have enough followers. See raw data and source code. Algorithm in pseudocode:

githubUsers
@jlatt
jlatt / gist:2504275
Created April 26, 2012 23:56
Sex Porn

Sex Porn is the foundation of Sex Pics. When men are looking for Sex Pics, they inevitably have to Deal with Sex Porn. Laura's Sex Porn had slimy sex with sexage pussy and gardners is little sex that the butt thinks is furry on Sex Porn. Sex Pics is the ultimate goal of hardcore. Once you have Dealt with the Sex Porn, you can proceed to the Sex Pics. Example. Pamela went to the Sex Pics pics and saw hardcore pics full of blowjobs and cumshots. The Sex Pics too much for her huge tits to handle. You must have your reasons for wanting Sex Porn. I went to the store to look for Sex Porn. I only found Sex Pics. Cheerleaders, blowjobs, and cumshots lined the shelves. I pulled down a can of wet pussy. Hardcore sexagers surrounded the young pussy pics. sexs with dildos rushed to rub the can of smelly pussy. I grabbed the huge tits, and watched them partake in blowjobs and cumshots. Luckily my sex slut was with me and grabbed the cheerleader pussy, Sex Porn, wet pussy, and Sex Pics. Celebs grabbed my hairy pussy and to

@amiller
amiller / gist:2232636
Created March 29, 2012 02:33
alternate bitcoin proof of work
"""
An alternate proof-of-work scheme for Bitcoin where competitive mining implies a
low marginal cost of "honesty." The new work has nothing to do with GPUs, but
instead requires random access to the 'tx_outputs' database, just as you would need
in order to thoroughly double check incoming transactions against history, i.e. to
be "honest" in the sense of the Satoshi paper [1]. May we lug Ascii Bernanke around
forever.
Parameters:
N: the total number of txoutputs, each of which can be spent at most once
@danielberlinger
danielberlinger / performance.rb
Created March 27, 2012 20:10
A Rails initializer for using Rails 3 notifications and statsd
require 'statsd'
$statsd = Statsd.new('your_host_here')
ActiveSupport::Notifications.subscribe /process_action.action_controller/ do |*args|
event = ActiveSupport::Notifications::Event.new(*args)
controller = event.payload[:controller]
action = event.payload[:action]
format = event.payload[:format] || "all"
format = "all" if format == "*/*"
status = event.payload[:status]