Skip to content

Instantly share code, notes, and snippets.

View RodolfoFerro's full-sized avatar
🐍
I speak Python.

Rodolfo Ferro RodolfoFerro

🐍
I speak Python.
View GitHub Profile
@atduskgreg
atduskgreg / arduino_firmware.cpp
Created November 8, 2011 20:52
send multiple values over serial from Processing to Arduino
int currentValue = 0;
int values[] = {0,0};
void setup() {
Serial.begin(9600);
}
void loop() {
if(Serial.available()){
@dellis23
dellis23 / markov.py
Created August 7, 2013 15:09
A more flexible version of a markov chain implementation found at http://agiliq.com/blog/2009/06/generating-pseudo-random-text-with-markov-chains-u/
import random
class Markov(object):
def __init__(self, open_file, chain_size=3):
self.chain_size = chain_size
self.cache = {}
self.open_file = open_file
self.words = self.file_to_words()
self.word_size = len(self.words)
@rxaviers
rxaviers / gist:7360908
Last active July 20, 2024 10:36
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@joshukraine
joshukraine / how-to-install-powerline-on-osx.md
Last active August 10, 2020 03:04
How to Install Powerline on OS X

How to Install Powerline on OS X

Preface

This whole thing hinges on having the right version of Python installed. We're going to do it via Homebrew. You have to install Python BEFORE you install Vim. So if Vim is already installed (the Homebrew version, that is) then remove it first.

Installation

Check to see if vim or python are installed.

brew list

@adam-p
adam-p / Local PR test and merge.md
Last active February 5, 2024 19:39
Testing a pull request, then merging locally; and avoiding TOCTOU

It's not immediately obvious how to pull down the code for a PR and test it locally. But it's pretty easy. (This assumes you have a remote for the main repo named upstream.)

Getting the PR code

  1. Make note of the PR number. For example, Rod's latest is PR #37: Psiphon-Labs/psiphon-tunnel-core#37

  2. Fetch the PR's pseudo-branch (or bookmark or rev pointer whatever the word is), and give it a local branch name. Here we'll name it pr37:

$ git fetch upstream pull/37/head:pr37
@vinhkhuc
vinhkhuc / simple_mlp_theano.py
Last active December 6, 2020 05:46
Simple Feedforward Neural Network using Theano
# Implementation of a simple MLP network with one hidden layer. Tested on the iris data set.
# Requires: numpy, sklearn, theano
# NOTE: In order to make the code simple, we rewrite x * W_1 + b_1 = x' * W_1'
# where x' = [x | 1] and W_1' is the matrix W_1 appended with a new row with elements b_1's.
# Similarly, for h * W_2 + b_2
import theano
from theano import tensor as T
import numpy as np
from sklearn import datasets
@mcoms
mcoms / Gemfile
Created May 6, 2015 22:42
Fruit Piano prototype with MPR121, Arduino and Sonic Pi
source 'https://rubygems.org'
gem 'osc-ruby', '1.1.1'
gem 'serialport'
@jindrichmynarz
jindrichmynarz / dub_techno_in_sonic_pi.rb
Created December 8, 2015 19:11
Dub techno in Sonic Pi
use_debug false
use_bpm 130
# Our mixer!
master = (ramp *range(0, 1, 0.01))
kick_volume = 1
bass_volume = 1
revbass_volume = 1
snare_volume = 0.5
hats_volume = 0.5
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@RodolfoFerro
RodolfoFerro / install.sh
Created September 27, 2016 08:59
PyGame for Python 3 Mac
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
alias brew=/usr/local/bin/brew
brew install python3
alias python=python3
brew install mercurial
brew install git
brew install sdl sdl_image sdl_mixer sdl_ttf
brew tap homebrew/headonly
brew install --HEAD smpeg
brew install portmidi