Skip to content

Instantly share code, notes, and snippets.

View freeslugs's full-sized avatar
💭
🔥👀🧽

Gilad freeslugs

💭
🔥👀🧽
View GitHub Profile
@freeslugs
freeslugs / scramble.js
Created May 25, 2022 16:48
found this on a random website online
class TextScramble {
constructor(el) {
this.el = el
this.chars = '!<>-_\\/[]{}—=+*^?#________'
this.update = this.update.bind(this)
}
setText(newText) {
const oldText = this.el.innerText
const length = Math.max(oldText.length, newText.length)
const promise = new Promise((resolve) => this.resolve = resolve)
@freeslugs
freeslugs / download.sh
Created November 10, 2020 18:23
how to save jw player to mp4
# create a new temp folder, and run this script there.
# todo: 257 is hardcoded end, but can probably be determined once wget returns error
for i in {1..257}
do
# networks tab will show .ts files. Let's download all of them.
wget "https://800evg.moekawaii.stream/hls/vx7wjj2pt65s7pl2y5f6w43emwslnmnkqajtswnsbwetpho773ehle5cgxsq/seg-$i-v1-a1.ts" -o
done
touch list.txt; for f in *.ts ; do echo file \'$f\' >> list.txt; done && sort -V list.txt -o list.txt; ffmpeg -f concat -safe 0 -i list.txt -c copy stitched-video.mp4 && rm list.txt
# all done, now we have our mp4 called stitched-video.mp4
https://jsbin.com/ziwod/2/edit
@freeslugs
freeslugs / README.md
Last active November 17, 2015 17:18
how to docker - flask

how to python - flask

install docker on mac

  • you'll need virtualbox: brew cask install virtualbox
  • brew install docker
  • install toolbox
@freeslugs
freeslugs / mattsucks
Created February 15, 2015 18:27
matt sucks
import requests
for x in xrange(0,1000):
r = requests.post("http://mattsucks.org/mattsucks")
print x, r.text
@freeslugs
freeslugs / little async example
Created February 3, 2015 19:15
little async example
function asyncFn (param1, param2, callback) {
console.log(param1); // "apple"
console.log(param1); // "orange"
var a = 1;
var b = 2;
// do some async magic here
callback(a,b);
}
import java.util.ArrayList;
import java.util.Arrays;
import java.lang.Math;
public class YummySoup extends Ingredient{
static Oil canola = new Oil("canola");
static Ingredient[] favoriteVeggies = {new Ingredient("onions"), new Ingredient("peppers")};
static Spice[] sAndP = {new Spice("salt"), new Spice("pepper")};
static Ingredient water = new Ingredient("water");
public static void main(String[] args){
require 'watir'
require 'rubygems'
require 'rspec'
require 'http'
require 'tempfile'
# HEY! Run this using "rspec test.rb" in terminal
RSpec.configure do |config|
# Use color in STDOUT