Skip to content

Instantly share code, notes, and snippets.

View flohdot's full-sized avatar

Florencia Herra Vega flohdot

View GitHub Profile
@jdhenke
jdhenke / mashup.py
Last active January 26, 2018 14:31
Use Markov Models to mimic the text from a document or "mashup" several different documents.
#!/usr/bin/python
'''
MARKOV MODEL MASHUPS
Creates 'lyrical mashups' using Markov Models.
Can use characters or words as state. (You should add more mediums!)
Example files used:
mashup.py # this script
sonnets.txt # all of shakespeare's sonnets
@ryanray
ryanray / deploy.rb
Created November 21, 2013 11:15
I couldn't find a quick example of how to deploy a node.js app using Capistrano 3. This gist assumes you are using Capistrano 3, Upstart, Forever, ssh/forward agent, and an unprivileged user named 'deploy'. Hopefully this simple setup will help to get you started.
# config/deploy.rb
# probably a lot of ways to improve this...
set :application, 'my_app'
set :repo_url, 'git@github.com:USERNAME/my_app.git'
# should set up a deploy user
set :user, 'deploy'
set :deploy_to, '/var/www/my_app'
set :scm, :git
@jabney
jabney / entropy.js
Last active January 29, 2024 23:38
Javascript implementation of a Shannon entropy calculation in bits per symbol
// entropy.js MIT License © 2014 James Abney http://github.com/jabney
/***************************************
* ES2015
***************************************/
// Shannon entropy in bits per symbol.
function entropy(str) {
const len = str.length
@ralph089
ralph089 / .wakeup
Last active February 17, 2024 09:56
Restarts Bluetooth Module on Mac OS X. You can use the script as shortcut to restart Bluetooth on demand or you can use it with "SleepWatcher" to automatically restart Bluetooth on wakeup (See README.md). I created it, because my Logitech Bluetooth Mouse doesn't stay connected after sleep-mode, so i had to manually re-pair my mouse.
#!/bin/bash
#
# Restart Bluetooth Module on Mac OS X
#
# Requires Blueutil to be installed: http://brewformulas.org/blueutil
BT="/usr/local/bin/blueutil"
log() {
echo "$@"