Skip to content

Instantly share code, notes, and snippets.

@Lytol
Lytol / pi.js
Last active March 17, 2021 23:53 — forked from ggrumbley/pi.js
// Define a method that rounds pi to a specified decimal place
// Return Pi and how many iterations of the following formula that it took to accomplish
// pi = 4 * (1 – 1/3 + 1/5 – 1/7 + ...)
function* pi() {
let n = 1;
let series = 0;
while(true) {
next = 1/(n*2-1)
@Lytol
Lytol / IRSSI Cheat Sheet.md
Last active January 24, 2020 04:57
IRSSI Cheat Sheet

General

  • /quit – Quit IRSSI

Windows

  • option+# – Navigate to specified window
  • ctrl-n – Navigate to next window
  • ctrl-p – Navigate to previous window

Pok3r Custom Mapping

DIP switch config for QWERTY with Caps Lock FN

1: off
2: off
3: on

4: off

@Lytol
Lytol / selection_sort.scala
Created November 4, 2009 06:45
Selection sort implementation in Scala
// Inmperative version
//
def selectionSort(list: Array[Int]): Unit {
def swap(list: Array[Int], i: Int, j: Int) {
var tmp = list(i)
list(i) = list(j)
list(j) = tmp
}
var i = 0
@Lytol
Lytol / ultemplate.rb
Created September 23, 2010 07:02
Rails 3 Application Template
# Rails application template for Rails 3 + Postgres + Git + haml + JQuery + Rspec + Cucumber + Capybara + FactoryGirl
# by Brian Smith <bsmith@swig505.com>
# Create a default README
file "README.md", <<-EOF
#{app_name}
#{"=" * app_name.length}
TODO: description
# Rails template for a basic project assuming the following:
#
# - MySQL for the DB
# - Git for version control
#
# Example: rails myapp -d mysql -m RailsTemplate.rb
#
# Author: Brian Smith (bsmith@swig505.com)
#
# Actions:
@Lytol
Lytol / layer1.kll
Created April 21, 2015 06:23
Lytol's Keyboard Layout for Infinity Keyboard
Name = Layer1;
Version = 0.1.0;
Author = "Brian Smith <brian.e.smith@gmail.com";
KLL = 0.3;
# Modified Date
Date = 2015-03-05;
# Number row
@Lytol
Lytol / csgo.md
Last active December 28, 2015 15:28
Counter-Strike:GO Server

Game Modes

  • Classic Casual - game_type 0 game_mode 0
  • Classic Competitive - game_type 0 game_mode 1
  • Arms Race - game_type 1 game_mode 0
  • Demolition - game_type 1 game_mode 1
  • Deathmatch - game_type 1 game_mode 2

General

@Lytol
Lytol / gist:5015688
Last active December 14, 2015 02:39
Beginner's Guide to Vim
require 'yaml'
module MyRailsApp
module Config
extend self
def [](key)
hash[key.to_sym]
end