Skip to content

Instantly share code, notes, and snippets.

View Softwave's full-sized avatar

Softwave Softwave

View GitHub Profile
@Softwave
Softwave / .emacs
Created October 29, 2016 02:55 — forked from ftrain/.emacs
a nice .emacs for when you are on a terminal. Respects scroll wheel events. Very useful when run inside of tmux and combined with this tmuxconf: https://gist.github.com/ftrain/8443744
;; .emacs
;;; uncomment this line to disable loading of "default.el" at startup
;; (setq inhibit-default-init t)
;; enable visual feedback on selections
(setq transient-mark-mode t)
;; default to better frame titles
(setq frame-title-format
@Softwave
Softwave / How to connect a PS3 controller.md
Created June 21, 2016 05:11 — forked from hlung/How to connect PS3 controller to a Mac or PC.md
How to connect PS3 controller on Mac OSX, PC

How to connect PS3 controller on Mac OSX, PC, etc.

This is how you connect PS3 controller to Mac OSX, PC, etc. when previously connected to a PS3. You will need a Mini USB cable. Overcome your laziness, get up of your chair, and go get one!

A big misconception is that keep holding PS button will reset the controller's pairing. It DOES NOT! From my testings, the controller keeps paring with the last machine it was CONNECTED VIA A USB CABLE.

Here are the steps:

; ___ _ __ ___ __ ___
; / __|_ _ __ _| |_____ / /| __|/ \_ )
; \__ \ ' \/ _` | / / -_) _ \__ \ () / /
; |___/_||_\__,_|_\_\___\___/___/\__/___|
; An annotated version of the snake example from Nick Morgan's 6502 assembly tutorial
; on http://skilldrick.github.io/easy6502/ that I created as an exercise for myself
; to learn a little bit about assembly. I **think** I understood everything, but I may
; also be completely wrong :-)
@Softwave
Softwave / irssi-cheat-sheet.md
Created November 19, 2015 01:04
Irssi Cheat Sheet

Cheat Irssi

Short cheatsheet handy while learning to use Irssi. Adapted from IRC-client.md by Nishant Modak.

  1. To switch between open channels / windows

    Alt + N where N is the number corresponding to the open window

  2. To ignore joins / quits / nicks changes on a specific channel.

@Softwave
Softwave / steps.md
Created September 25, 2015 22:02 — forked from mobeets/steps.md
playing music with Overtone on OSX inside Sublime Text 2

This was surprisingly simple given how many things there were to do! (Usually it seems like something breaks when there's this many steps between me and installing something.)

Installations

/* OpenSimplex Noise in C#
* Ported from https://gist.github.com/KdotJPG/b1270127455a94ac5d19
* and heavily refactored to improve performance. */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
namespace NoiseTest
data Color = Red | Black | Rgb Int Int Int
toString : Color -> String
toSring color =
case color of
Red -> "Red"
Black -> "Black"
Rgb r g b -> "Other"
Scripting:
(1) Here is an example script (all one file):
#(init) input, sprite -- An "init" event (runs once) that initializes the "input" and "sprite" packages
Sprite.AddTrail(-1); -- This function is called from the sprite package (without sprite, it will crash)
#(init) controller -- Another "init" event that initializers the "controller" package (so that it can be used in update)
#(update) input, controller -- An "update" event that uses the "input" and "controller" packages
if (Input.Left())
Controller.Move(-100.0);
// by dave @ beesandbombs.tumblr.com >:)
void setup() {
setup_();
result = new int[width*height][3];
result_ = new int[width*height][3];
}
int[][] result, result_;
float time;
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Stopwatch</title>
</head>
<body onload="show();">
<div>Time: <span id="time"></span></div>
<input type="button" value="start" onclick="start();">
<input type="button" value="stop" onclick="stop();">