Skip to content

Instantly share code, notes, and snippets.

@pksunkara
pksunkara / config
Last active November 15, 2024 16:02
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = [email protected]
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@mxriverlynn
mxriverlynn / marionette.gauntlet.js
Last active September 25, 2018 18:13
Marionette.Gauntlet - an event based "state machine" of sorts, used for building wizard, breadcrumb and tab UI and navigation systems
// Marionette.Gauntlet v0.0.0
// --------------------------
//
// Build wizard-style workflows with an event-emitting state machine
// Requires Backbone.Picky (http://github.com/derickbailey/backbone.picky)
//
// Copyright (C) 2012 Muted Solutions, LLC.
// Distributed under MIT license
Marionette.Gauntlet = (function(Backbone, Picky, Marionette, $, _){
@monokrome
monokrome / commands
Last active December 17, 2018 22:33
Some of my weechat settings
/key bind meta-ctrl-I /go
/key unbind ctrl-W
/key bind ctrl-Wl /window right
/key bind ctrl-Wh /window left
/key bind ctrl-Wj /window down
/key bind ctrl-Wk /window up
/key bind ctrl-Wmeta2-C /window right
@monokrome
monokrome / osx_settings.sh
Created May 11, 2013 01:42
Making OS X suck less.
#!/usr/bin/env sh
sudo defaults write -g ApplePressAndHoldEnabled -bool false
sudo defaults write -g NSScrollViewRubberbanding -int
sudo defaults write com.apple.iTunes disable-elastic-scroll -bool YES
@monokrome
monokrome / example.py
Created June 20, 2013 18:49
Templates using built-in Python string formatting.
from .utils import template
x = template('example.sh', '~', options='-al')
@monokrome
monokrome / models.coffee
Last active December 19, 2015 12:28
Polymorphic relatedModel for backbone-associations
{polymorphic} = require 'polymorphic'
class OtherModel extends Backbone.Model
class YetAnotherOtherModel extends Backbone.Model
class MyModel extends Backbone.Model
relations: [
type: Backbone.One
key: 'otherUri'
@monokrome
monokrome / itunes_receipts.py
Last active December 19, 2015 17:39
Search within a mailbox for iTunes receipts, and write a JSON representation of all iTunes receipts as 'receipts.json'.
#!/usr/bin/env python
import mailbox
mailbox_root = 'your_mailbox'
mailbox_type = mailbox.Maildir
###########################################
###########################################
## Configuration section finished. ##
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active November 18, 2024 03:02
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@atoponce
atoponce / gist:07d8d4c833873be2f68c34f9afc5a78a
Last active September 7, 2024 18:11 — forked from tqbf/gist:be58d2d39690c3b366ad
Cryptographic Best Practices

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@inexorabletash
inexorabletash / @ IndexedDB Full Text Search (Proof of Concept).md
Last active September 8, 2024 10:28
IndexedDB Full Text Search (Proof of Concept)

This demonstrates the implementation of full text search for documents in Indexed DB.

  • Word-breaking and stemming is used to create a list of terms for each document.
  • Document records are annotated with the list of terms when added to the database.
  • A multi-entry index on the list of terms is populated.
  • A query is similarly processed into a list of terms.
  • A join over the terms is implemented using multiple cursors on the index.

The necessity of annotating records with the word list to populate the index is a limitation of the current Indexed DB API. A feature request to support custom