Skip to content

Instantly share code, notes, and snippets.

View sbrl's full-sized avatar

Starbeamrainbowlabs sbrl

View GitHub Profile
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
javascript:(function(){
var delay=60000, delay2=1000, intensity=0.0, timer, timer2, i=0;
function reset(){document.documentElement.setAttribute('style',''); clearTimeout(timer); clearTimeout(timer2); intensity = 0.0; i = 0; timer = setTimeout(blur, delay);}
function blur(){
if(intensity<6){
intensity+=0.5;
applyBlur(intensity);
timer2 = setTimeout(blur, delay2);
}
}
@rain1024
rain1024 / tut.md
Last active May 6, 2024 06:12
Install pdflatex ubuntu

PdfLatex is a tool that converts Latex sources into PDF. This is specifically very important for researchers, as they use it to publish their findings. It could be installed very easily using Linux terminal, though this seems an annoying task on Windows. Installation commands are given below.

  • Install the TexLive base
sudo apt-get install texlive-latex-base
  • Also install the recommended and extra fonts to avoid running into the error [1], when trying to use pdflatex on latex files with more fonts.
/* An HTML template in 180 bytes (minified)
Features: Escapes HTML, accepts either strings or functions as values, and that's all (it doesn't handle looping).
Usage:
OneEightyT(
"<h1>{name}</h1><div>{content} @ {currentTime}</div>",
{
name: "Stella",
@tokestermw
tokestermw / preprocess-twitter.py
Last active January 2, 2023 07:16
Python version of Ruby script to preprocess tweets for use in GloVe featurization http://nlp.stanford.edu/projects/glove/
"""
preprocess-twitter.py
python preprocess-twitter.py "Some random text with #hashtags, @mentions and http://t.co/kdjfkdjf (links). :)"
Script for preprocessing tweets by Romain Paulus
with small modifications by Jeffrey Pennington
with translation to Python by Motoki Wu
Translation of Ruby script to create features for GloVe vectors for Twitter data.
@need12648430
need12648430 / lcg.js
Last active August 29, 2015 14:20
Linear congruential generator (Seedable PRNG) with weighted choices and shuffling in 1.4kb of clean JS.
var LCG = (function () {
var c = 0x93456789, a = 0x169659, mod, mask, r;
mask = (mod = Math.pow(2, 31)) - 1;
function LCG(seed) {
this.seed = seed || new Date().getTime();
}
LCG.prototype = {
nextInt:
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active May 3, 2024 11:35
Hyperlinks in Terminal Emulators

Generating Procedural Game Worlds with Wave Function Collapse

Wave Function Collapse (WFC) by @exutumno is a new algorithm that can generate procedural patterns from a sample image. It's especially exciting for game designers, letting us draw our ideas instead of hand coding them. We'll take a look at the kinds of output WFC can produce and the meaning of the algorithm's parameters. Then we'll walk through setting up WFC in javascript and the Unity game engine.

sprites

The traditional approach to this sort of output is to hand code algorithms that generate features, and combine them to alter your game map. For example you could sprinkle some trees at random coordinates, draw roads with a brownian motion, and add rooms with a Binary Space Partition. This is powerful but time consuming, and your original vision can someti

@orangeblock
orangeblock / handler.sh
Last active May 13, 2023 16:52
GitHub webhook listener, using netcat and bash. `listen.sh` and `handler.sh` must be in the same directory. Start with `./listen.sh <port> <path-to-script> [<endpoint>]`. All files (including scripts) must be executable.
#!/bin/bash
# parse endpoint (only works for POST)
read request
url="${request#POST }"
url="${url% HTTP/*}"
# change this!!!
secret="top-secret"
@ppope
ppope / preprocess_twitter.py
Last active May 13, 2021 14:32 — forked from tokestermw/preprocess-twitter.py
FORK: Python version of Ruby script to preprocess tweets for use in GloVe featurization http://nlp.stanford.edu/projects/glove/.
"""
preprocess-twitter.py
python preprocess-twitter.py "Some random text with #hashtags, @mentions and http://t.co/kdjfkdjf (links). :)"
Script for preprocessing tweets by Romain Paulus
with small modifications by Jeffrey Pennington
with translation to Python by Motoki Wu
Translation of Ruby script to create features for GloVe vectors for Twitter data.