Skip to content

Instantly share code, notes, and snippets.

View jfarid27's full-sized avatar
💭

Jalil F. jfarid27

💭
View GitHub Profile
@jfarid27
jfarid27 / keybase.md
Created July 30, 2021 14:10
keybase.md

Keybase proof

I hereby claim:

  • I am jfarid27 on github.
  • I am monteluna (https://keybase.io/monteluna) on keybase.
  • I have a public key ASDMmlpldbZWjR3VkFnTFetWVSdWLEK4xrjngvWrkImkFAo

To claim this, I am signing this object:

@jfarid27
jfarid27 / running-example.csv
Created May 24, 2019 15:16
Personascope Mock File
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
SessionID;ID;Date;Action;Resource;Costs
1;35654423;30-12-2010:11.02;register request;Pete;50
1;35654424;31-12-2010:10.06;examine thoroughly;Sue;400
1;35654425;05-01-2011:15.12;check ticket;Mike;100
1;35654426;06-01-2011:11.18;decide;Sara;200
1;35654427;07-01-2011:14.24;reject request;Pete;200
2;35654483;30-12-2010:11.32;register request;Mike;50
2;35654485;30-12-2010:12.12;check ticket;Mike;100
2;35654487;30-12-2010:14.16;examine casually;Sean;400
2;35654488;05-01-2011:11.22;decide;Sara;200
@jfarid27
jfarid27 / ace-key.pub
Last active August 17, 2018 13:39
Comp-Keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzsmNG7+Deu7tLL/Vc0W0a+osXcXpXSWeniQ3SFmyErD77v0O75RftSaKdrhXOC1HhDA3bsi81Kr96xCWzxKDZDrh6AW7S7S7v6KlmzBWfZhslvjIen//IOoTfWV57OgIInBPk2TcbyP1hniZNv5U8JPXsHr0UTxOeOVJLz63fL6o/w17+RC+MoyhQAl/MytCIAJgyDJiOcc9XE7MnRNDKUwivoZYCte8ndGOmIUY7YU/JYekrvbTn6VlKq6MFrdpkCbCs1Sb/z4+szMUcZ43CpAEbTXY8RKYznLUam0SBxAq4bl1/9+QST1LvWzuWFhkbtgWMDByY4h30xonlxJI1 jalil@jalil-Aspire-R5-571TG
@jfarid27
jfarid27 / Trump.R
Last active July 21, 2016 23:00
Simulates outcomes of electoral college votes
## Trump winning distribution using RealClear politics map
# http://www.realclearpolitics.com/epolls/2016/president/2016_elections_electoral_college_map.html
TrumpVsClinton <- function(){
set.seed(23952359)
#Represents the toss-up states possible votes
#NV, AZ,IA, WI, OH, VA, NC, GA, FL, NH, PA, GA, ME2
statesVotingTossups = c( 6, 11, 6, 10, 18, 13, 15, 16, 29, 4, 20, 16, 1)
@jfarid27
jfarid27 / Bootstrapping.py
Created March 7, 2016 16:28
A bootstrapping example
def bootstrapping(observable, dataset, samples=1000):
observableDist = []
for n in range(samples):
sample = []
for k in range(len(data))
sample.append(dataset[random.randint(0, len(dataset)-1)])
observableDist.append(observable(sample))
return observableDist
@jfarid27
jfarid27 / redo.js
Last active October 17, 2015 17:30
var zlib = require("zlib");
var jsonstream = require("json-stream");
var fs = require("fs");
var combine = require("combine-streams");
var Readable = require("stream").Readable;
var Async = require("async");
var work = function(cachedir, file){
return function(callback) {
if (file.endsWith(".json.gz") && file.indexOf(dateprefix)>-1) {
@jfarid27
jfarid27 / computeEntropy.js
Created May 31, 2015 00:07
Entropy computer
var generate = Math.random
var nsteps = 10000000
var holds = {}
for (var i = 0; i < nsteps; i++){
holds[generate()] = holds[generate()] ? holds[generate()] + 1 : 1
}
@jfarid27
jfarid27 / sample_data.json
Last active August 29, 2015 14:19
Sample Data
{
"Scen_Time": [0.0, 0.0027397260273972603, 0.005479452054794521, 0.008219178082191782, 0.010958904109589041, 0.0136986301369863, 0.016438356164383564, 0.019178082191780823, 0.021917808219178082, 0.024657534246575342, 0.0273972602739726, 0.030136986301369864, 0.03287671232876713, 0.03561643835616438, 0.038356164383561646, 0.0410958904109589, 0.043835616438356165, 0.04657534246575343, 0.049315068493150684, 0.052054794520547946, 0.0547945205479452, 0.057534246575342465, 0.06027397260273973, 0.06301369863013699, 0.06575342465753425, 0.0684931506849315, 0.07123287671232877, 0.07397260273972603, 0.07671232876712329, 0.07945205479452055, 0.0821917808219178, 0.08493150684931507, 0.08767123287671233, 0.09041095890410959, 0.09315068493150686, 0.0958904109589041, 0.09863013698630137, 0.10136986301369863, 0.10410958904109589, 0.10684931506849316, 0.1095890410958904, 0.11232876712328767, 0.11506849315068493, 0.1178082191780822, 0.12054794520547946, 0.12328767123287672, 0.12602739726027398, 0.12876712328767123, 0.13150
@jfarid27
jfarid27 / gulp_chunk.js
Last active August 29, 2015 14:13
gulputil vinyl file pipe to destination
var configString = head + body + footer
var buffer = new Buffer(configString)
var file = new gutil.File({contents:buffer, path:'karma.config.js'})
function readableWrapper(params, options){
Readable.call(this, options)
this._params = params
@jfarid27
jfarid27 / gulpfile.js
Created January 14, 2015 23:13
prototype gulpfile.js
var gulp = require('gulp'),
gutil = require('gulp-util'),
gbower = require('gulp-bower'),
bower = require('bower'),
fs = require('fs'),
del = require('del');
gulp.task('default', ['test'], function(){
return
})