Skip to content

Instantly share code, notes, and snippets.

@tsur
tsur / fps.html
Created April 21, 2017 14:29
Frames Per Second
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script type="text/javascript">
// 16ms - 60 fps, f = 1000/t
let lastDelta = Date.now();
@tsur
tsur / bot-cronjob.sh
Last active September 2, 2016 09:33
Slack breakfast bot seed
#!/usr/bin/env bash
# Set on "crontab -e" to run the bot every day at some specific time
# Load nvm
. ~/.nvm/nvm.sh
# Load bashrc
. $HOME/.bashrc
echo "Running nvm use stable"
nvm use stable
echo "Running script"
cd <absolute_path_to_bot> && node bot.js
@tsur
tsur / test.js
Last active July 21, 2020 10:28
serialize/deserialize es6 class
class MyChart {
constructor(){
this.foo = "foo";
return this;
}
sayFoo(){
@tsur
tsur / README.md
Last active November 24, 2016 12:56
raspberry pi - garage door opener

Note: Set all wires up before keeping reading. Negative jumper must go into 3rd pin right column and positive jumper into 4th pin left column (right and left looking ethernet port in pi in front of your eyes)

Upload this content into your pi:

if do not know how to access your pi, connect it to your local network and to your pc or power source and discover hosts with ssh enabled

$> nmap -p 22 -sV 192.168.1.0/24
meanings:
<C- Control
<S- Shift
<A- Alt
<T - Tab
<FN - Fn
### Finding
cat $1 | sed $'s/\xcd\xbe/\;/g' > $(echo "_unicode_$1") && $(mv "_unicode_$1" "$1")
# decode symbol: echo -n <paste_symbol_here> | hexdump
# encode symbol: echo -e "\xE2\x98\xA0"
@tsur
tsur / .vimrc
Last active June 16, 2016 11:38
vim distribution
execute pathogen#infect()
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
@tsur
tsur / chromedriver.sh
Created May 17, 2016 09:46
chromedriver
#install xvfb so we can run Chrome headlessly
sudo apt-get install xvfb
sudo apt-get install unzip
#chromedriver releases http://chromedriver.storage.googleapis.com/
wget -N http://chromedriver.storage.googleapis.com/2.20/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
chmod +x chromedriver
sudo mv -f chromedriver /usr/local/share/chromedriver
@tsur
tsur / linux-essentials.sh
Last active October 31, 2023 08:13
linux essentials
# Common
sudo apt-get update
sudo apt-get install build-essential gcc g++ make cmake htop curl unzip vim screen supervisor nmap sl meld git outguess firestarter
# Install gnome classic
sudo apt-get install gnome-session-fallback
# Install mate desktop
sudo apt-add-repository ppa:ubuntu-mate-dev/ppa
sudo apt-add-repository ppa:ubuntu-mate-dev/trusty-mate
@tsur
tsur / readme.md
Last active August 6, 2017 19:19
multiple ssh keys work setup

First create publick keys and name them as home_rsa and job_rsa

$ ssh-keygen -t rsa -C "[email protected]"
$ ssh-keygen -t rsa -C "[email protected]"

Then add them to ssh process: