Skip to content

Instantly share code, notes, and snippets.

View SeanFelipe's full-sized avatar

SeanFelipe

View GitHub Profile
@connorshea
connorshea / pygameinstall.md
Last active June 15, 2022 23:54
Installing Homebrew, Python, and Pygame on OS X
  1. Open the Terminal.
  2. Install Homebrew.
  1. Install Python 2.7 with brew install python
  • Optionally you can also install Python 3 with brew install python3
  • Installing either of these with install pip and pip3 respectively, a package manager for Python.
  1. Install prerequisites for pygame: brew install sdl sdl_image sdl_mixer sdl_ttf portmidi mercurial
  2. Install pygame using pip with pip install hg+http://bitbucket.org/pygame/pygame
@iwek
iwek / csv-to-json.js
Last active April 24, 2024 19:05
CSV to JSON Conversion in JavaScript
//var csv is the CSV file with headers
function csvJSON(csv){
var lines=csv.split("\n");
var result = [];
var headers=lines[0].split(",");
for(var i=1;i<lines.length;i++){
@cjolly
cjolly / README.md
Last active August 4, 2023 08:21
How to securely set rails secret key when you deploy to Heroku.

Stop Versioning Rails Secret Tokens

After reading Code Climate's Rails' Insecure Defaults I realized I was guilty of breaking rule 3. Versioned Secret Tokens. Here's how I fixed it.

Use dotenv in development and test environments:

# Gemfile
gem 'dotenv-rails', groups: [:development, :test]
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Pixmap.Format;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@peterc
peterc / dnsd.rb
Created December 2, 2011 23:47
Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# By Peter Cooper
#
# MIT license
#
# * Not advised to use in your production environment! ;-)
# * Requires Ruby 1.9
# * Supports A and CNAME records
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance
# * All records get the same TTL