Skip to content

Instantly share code, notes, and snippets.

View vforge's full-sized avatar
🔜
Great things!

Bartosz V. Bentkowski vforge

🔜
Great things!
View GitHub Profile
@vforge
vforge / mersenne-twister.ts
Last active September 7, 2022 04:08 — forked from banksean/mersenne-twister.js
A Mersenne Twister implementation in TypeScript. Makes up for Math.random() not letting you specify a seed value.
/*
* TypeScript port by Bartosz V. Bentkowski
*
* gist: https://gist.github.com/vforge/0aa8555507a0b06849cd20b142c3f74d
*/
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
@vforge
vforge / README.md
Last active April 16, 2021 19:24
Cross domain communication PoC

Cross domain communication PoC

Howto

  1. Put all files in one directory.
  2. Run python3 -m http.server 80 from it.
  3. Make sure you have localhost1.example.com and localhost2.example.com pointed to 127.0.0.1.
  4. Visit [http://localhost1.example.com] and open console.

Other links

esphome:
name: etekcity2
platform: ESP8266
board: esp01_1m
wifi:
ssid: xxxxx
password: yyyyyyy
# Enable logging
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define PIN 0
// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
[profile]
layer_height = 0.15
wall_thickness = 1.2
retraction_enable = True
solid_layer_thickness = 1.2
fill_density = 15
print_speed = 50
print_temperature = 200
print_temperature2 = 0
print_temperature3 = 0
@vforge
vforge / synthwave84.itermcolors
Created May 6, 2019 18:01
synthwave84 theme for iTerm
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
@vforge
vforge / RPi_I2C_driver.py
Created February 28, 2019 07:17 — forked from DenisFromHR/RPi_I2C_driver.py
RaspberryPi I2C LCD Python stuff
# -*- coding: utf-8 -*-
"""
Compiled, mashed and generally mutilated 2014-2015 by Denis Pleic
Made available under GNU GENERAL PUBLIC LICENSE
# Modified Python I2C library for Raspberry Pi
# as found on http://www.recantha.co.uk/blog/?p=4849
# Joined existing 'i2c_lib.py' and 'lcddriver.py' into a single library
# added bits and pieces from various sources
# By DenisFromHR (Denis Pleic)
@vforge
vforge / gist:f80f0a70d44afdc1bc24b6bbeaefd036
Created August 26, 2018 15:47
Delete all empty subdirectories in windows command line
for /f "delims=" %d in ('dir /s /b /ad ^| sort /r') do rd "%d"
@vforge
vforge / appify.sh
Created November 27, 2017 16:02
appify -- convert your non-interactive shell script into a Mac OS X application
#!/bin/bash
# source: https://git.abackstrom.com/appify.git/blob_plain/HEAD:/appify.sh
#
# appify -- convert your non-interactive shell script into a Mac OS X application
# Copyright (C) 2010 Adam Backstrom
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
@vforge
vforge / TransparentFiles.json
Last active November 7, 2016 20:31
Transparent GIFs and other files
{
"16x9": "data:image/gif;base64,R0lGODlhEAAJAIAAAP///////yH5BAEKAAEALAAAAAAQAAkAAAIKjI+py+0Po5yUFQA7",
"1x1": "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
}