Skip to content

Instantly share code, notes, and snippets.

View cooljith91112's full-sized avatar
💬
Making a Retro Game

Indrajith K L cooljith91112

💬
Making a Retro Game
View GitHub Profile

Keybase proof

I hereby claim:

  • I am cooljith91112 on github.
  • I am klias (https://keybase.io/klias) on keybase.
  • I have a public key ASDXk-d8F5fxHTnmsy4rXzrGYEQENBjYc4sIWqAQMdV_IQo

To claim this, I am signing this object:

@cooljith91112
cooljith91112 / swipe.js
Created February 23, 2018 04:42 — forked from SleepWalker/swipe.js
A simple swipe detection on vanilla js
var touchstartX = 0;
var touchstartY = 0;
var touchendX = 0;
var touchendY = 0;
var gesuredZone = document.getElementById('gesuredZone');
gesuredZone.addEventListener('touchstart', function(event) {
touchstartX = event.screenX;
touchstartY = event.screenY;
@cooljith91112
cooljith91112 / README.md
Created December 28, 2017 08:31 — forked from subfuzion/README.md
vim/neovim configuration

I recently switched over to neovim (see my screenshots at the bottom). Below is my updated config file.

It's currently synchronized with my .vimrc config except for a block of neovim-specific terminal key mappings.

This is still a work in progress (everyone's own config is always a labor of love), but I'm already extremely pleased with how well this is working for me with neovim. While terminal mode isn't enough to make me stop using tmux, it is quite good and I like having it since it simplifies my documentation workflow for yanking terminal output to paste in a markdown buffer.

These days I primarily develop in Go. I'm super thrilled and grateful for fatih/vim-go,

@cooljith91112
cooljith91112 / ie11-angular4-polyfills.ts
Last active August 30, 2022 18:59
Angular 4 IE11 Polyfills
let event;
if (document.createEvent) {
// IE11 - dispatch event doesn't support Event
event = document.createEvent('Event');
event.initEvent('input', true, true);
} else {
// Chrome
event = new Event('input');
}
this.el.nativeElement.dispatchEvent(event);

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@cooljith91112
cooljith91112 / gist:3148aa2c5821ce40c81ba7a2b3581e2a
Created November 16, 2016 09:00 — forked from lperrin/gist:123be96bfff9d0a9697a
Removing Unwanted scope variable from memory
app.directive('faFastScroll', ['$parse', function ($parse) {
var Interval = function(min, max) {
this.min = min || 0;
this.max = max || 0;
};
Interval.prototype.clip = function(min, max) {
if(this.max <= min || this.min >= max) {
this.min = this.max = 0;
@cooljith91112
cooljith91112 / ambient.rb
Created August 31, 2016 15:45 — forked from xavriley/ambient.rb
Ambient piece in Sonic Pi using multiple pentatonic scales
live_loop :foo do
with_fx :echo, mix: 0.3 do
sample :elec_tick if spread(2,7).tick
pattern1 = (knit :a3, 1, :d3, 1, :g3, 1)
pattern2 = (knit :a3, 1, :d3, 1, :g3, 1, :a0, 1)
pattern3 = (knit :a3, 1, :d3, 1, :g3, 1, :a5, 1)
structure = (knit pattern1, 128, pattern2, 32, pattern3, 32).tick(:structure)
@cooljith91112
cooljith91112 / README.md
Created August 31, 2016 15:43 — forked from xavriley/README.md
Original NES Mario Theme for Sonic Pi

Making Chiptune Music using Sonic Pi v2.0

Warning: this might not work on a RaspberryPi yet

I was curious about making retro gaming sounds using Sonic Pi. A couple of months and a lot of Googling later, here's the original Mario Bros theme as it was heard on the NES console.

I'm (just about) old enough to remember rushing home from school to play this game at Philip Boucher's house, sitting cross-legged in front of the TV till my feet got pins and needles. Working out how to recreate it for Sonic Pi was a lot of fun!

Getting the sounds of the NES chip

@cooljith91112
cooljith91112 / awesomeness_1.rb
Last active August 26, 2016 18:28
Sonic Pi - Composition 1 - Baby step to the awesomeness
# Author : Indrajith K L
# Title : Baby step to the awesomeness
live_loop :nehaneha do
sample :ambi_choir, rate: 0.5
sleep 1.5
sample :ambi_choir, rate: 0.3
sleep 1.8
sample :ambi_choir, rate: 0.5
sleep 1.5
end
@cooljith91112
cooljith91112 / lodash_random_numbers_floating.js
Created July 15, 2016 05:32
Lodash Random Decimal Numbers
.ceil(_.random(1,5, true),2); //Generate Random numbers between 1 & 5 with precision of 2. ex: 4.56