Skip to content

Instantly share code, notes, and snippets.

@DGaffney
DGaffney / LSTM-demo.py
Created February 9, 2024 18:22
LSTM Demo Code with tunable transition matrix to illustrate increasing predictive power with increasing memory dependence on prior states
#apt-get update && apt-get install -y tmux htop unzip nvtop zip rsync libpq-dev nano
#python3 -m pip install scikit-learn pandas tensorflow
from collections import Counter, defaultdict
import csv
import hashlib
import random
import numpy as np
import pandas as pd
from sklearn.model_selection import KFold
from tensorflow.keras.models import Sequential
@DGaffney
DGaffney / Gemfile
Last active February 28, 2019 02:44
oauth_dance_mini_site.rb
source 'https://rubygems.org'
gem 'pry'
gem 'sinatra'
gem 'twitter'
gem 'oauth'
["ABCD", "cocoa", "Cocoa Puff", "coconut", "colored", "coloured", "Jerry", "crow", "Angie", "Ann", "apple", "jock", "Junior Mint", "banana", "egg", "eggplant", "bans and cans", "fez", "black Barbie", "blockhead", "frog", "fuzzy", "fuzzy wuzzy", "book book", "brownie", "bubble", "buck", "bumblebee", "can eater", "celestial", "monkey", "Charlie", "ho", "hoe", "chief", "skinny", "mack", "mick", "mickey", "Mickey Finn", "Aunt Jane", "Aunt Jemima", "Aunt Mary", "Aunt Sally", "uncircumcised baboon", "Cushite", "Cushi", "Kushi", "Kushite", "dyke", "fruit", "inyenzi", "faranji", "shahktyer", "squarehead", "guala", "guala guala", "gook", "cholo", "wetback", "naco", "aracuano", "judas", "nigger", "paki", "amakwerekwere", "kwerekwere", "kweri kweri", "kwiri kwiri", "japie", "tizzone", "ditsoon", "tizzoni", "kala", "tapette", "pato", "beaner", "fag", "bule", "spice nigger", "ling ling", "Ami", "katol", "culona inchiavabile", "Schwuchtel", "Fotze", "Sack", "Schwanzlutscher", "carcamano", "Schlampe", "Neger", "Hure", "Hure
@DGaffney
DGaffney / gist:f46fe22e750b474ddec9dcb08110ef7b
Created October 22, 2018 16:50
software_adview_review_snippet_content_pre_oct_21_2018.html
<div class="row">
<div class="panel--invisible">
<div class="large-12 columns">
<div class="row">
<div class="large-12 columns">
<h3 class="reviewName">Google Drive is the best product out there for free!</h3>
</div>
</div>
<div>
<div class="row">
@DGaffney
DGaffney / gist:6275eaa31101d9c86934757cbd0cf18f
Created October 22, 2018 16:32
software_advice_review_snippet_10_21_2018.html
<div class="panel radius panel__product__review-title--blue">
<div class="row">
<div class="medium-7 columns">
<p class="no-margin">
<strong>
<span class="reviewAuthor">Michael</span> from Marketing Macabre
</strong>
<br>
Specialty:&nbsp;Other
<br>
@DGaffney
DGaffney / gist:f704d43dbb0b703f59f870a4159fee89
Created October 22, 2018 16:31
software_advice_review_snippet_10_21_2018.html
<div class="row u-mb-24 u-pb-14 review">
<div class="col-lg-4">
<div class="card x2">
<!---->
<div class="review-profile">
<p class="ui">
<strong class="review-profile-name">Gary</strong> from <strong class="review-profile-company">L.E.A.N. 4 Jesus Ministries, Inc.</strong>
</p>
</div><!----><!---->
<div class="review-ranking">
//api.js
var request = require('request-json');
var base_url = "http://192.168.1.165:8080/v1/"
var client = request.newClient(base_url);
exports.request = function (url) {
client.get(base_url+url, function (error, response, body) {
return body
})
};
class Array
def join_with_oxford_comma(delimiter=", ")
string = ""
if self.length == 1
string = self.first
elsif self.length == 2
string = self.join(" and ")
else
self.each_with_index do |elem,i|
if i == 0
class Array
def join_with_oxford_comma(delimiter=", ")
string = ""
if self.length == 1
string = self.first
elsif self.length == 2
string = self.join(" and ")
else
self.each_with_index do |elem,i|
if i == 0
@DGaffney
DGaffney / gist:5920273
Created July 3, 2013 16:39
Invite Codes
http://bit.ly/14NJ3cX
http://bit.ly/1b7HQSp
http://bit.ly/14NJ5S3
http://bit.ly/1b7HV8H
http://bit.ly/14NJa8n
http://bit.ly/1b7HYS3
http://bit.ly/14NJbJx
http://bit.ly/1b7HZW7
http://bit.ly/14NJd40
http://bit.ly/1b7HYBq