Skip to content

Instantly share code, notes, and snippets.

@elmarcoh
elmarcoh / rbx_telegram_dark.css
Created January 9, 2020 01:37
Dark mode for Telegram on Rambox (paste in "custom script")
function applycss(css){
var head = document.getElementsByTagName('head')[0];
var s = document.createElement('style');
s.setAttribute('type', 'text/css');
s.appendChild(document.createTextNode(css));
head.appendChild(s);
}
applycss(`
body,
.modal-content {
@elmarcoh
elmarcoh / rambox_whatsapp_dark.css
Last active February 1, 2020 00:42
Rambox custom code for Whatsapp dark mode (paste under "Custom Script" in rambox), stolen from https://userstyles.org/styles/142096/dark-whatsapp-theme-by-mew
function applycss(css){
var head = document.getElementsByTagName('head')[0];
var s = document.createElement('style');
s.setAttribute('type', 'text/css');
s.appendChild(document.createTextNode(css));
head.appendChild(s);
}
applycss(`
/**
* Everything you need to know is below:
@elmarcoh
elmarcoh / esp8266.ino
Created December 2, 2015 20:05
Arduino Wifi
#include <SoftwareSerial.h>
SoftwareSerial ESP8266(2, 3);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600); //HARDWARE
ESP8266.begin(9600);//SOFTWARE
enviar_dato("AT", 1000);
@elmarcoh
elmarcoh / git_list_commits_to_develop.sh
Created August 19, 2015 18:10
List number of commits that are not in develop
for b in `git branch --remote`; do echo $b `git lg origin/develop..$b|wc -l` ; done
@elmarcoh
elmarcoh / game.sh
Created March 24, 2014 03:44
Run a game with wine using only one monitor (on multimonitor setup)
#!/usr/bin/env bash
xrandr --auto --output HDMI1 --above LVDS1
xrandr --output LVDS1 --off
WINEDEBUG=-all \
WINEPREFIX=~/.wineprefixes/spore \
/usr/bin/wine <game.exe>
@elmarcoh
elmarcoh / selenium_proxy.py
Last active October 31, 2017 23:13
Selenium + Browsermob proxy example
"""
Selenium webdriver + BrowserMob proxy example
First, you have to download browsermob:
wget --no-check-certificate https://s3-us-west-1.amazonaws.com/lightbody-bmp/browsermob-proxy-2.0-beta-9-bin.zip
unzip inside the directory you are running this
pip install selenium browsermob-proxy
░░░░░░░░░▄░░░░░░░░░░░░░░▄░░░░
░░░░░░░░▌▒█░░░░░░░░░░░▄▀▒▌░░░
░░░░░░░░▌▒▒█░░░░░░░░▄▀▒▒▒▐░░░
░░░░░░░▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐░░░
░░░░░▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐░░░
░░░▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌░░░
░░▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒▌░░
░░▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐░░
░▐░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄▌░
░▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒▌░
@elmarcoh
elmarcoh / pair_generator.html
Created October 19, 2013 20:21
A dumb app to generate pairs for XP, useful for lazy rehashing
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Pair generator</title>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script type="text/javascript" charset="utf-8">
function make_pairs() {
people = $('#people').val().split('\n');
@elmarcoh
elmarcoh / grabssh
Created August 16, 2013 14:30
Fix ssh with auth (cert) fowarding (ssh -A) to work with screen Run this script prior to attaching or launching screen, and it will generate a file named "fixssh" exporting a series of envvars. Once on screen you must source ~/fixssh to use your machine's cert intead of the remote's one.
#!/bin/sh
SSHVARS="SSH_CLIENT SSH_TTY SSH_AUTH_SOCK SSH_CONNECTION DISPLAY"
for x in ${SSHVARS} ; do
(eval echo $x=\$$x) | sed 's/=/="/
s/$/"/
s/^/export /'
done 1>$HOME/fixssh
@elmarcoh
elmarcoh / install_node.sh
Created December 10, 2012 14:38
Install node & npm in virtualenv
#!/bin/sh
#
# This script will download NodeJS, NPM and lessc, and install them into you Python
# virtualenv.
#
# Based on a post by Natim:
# http://stackoverflow.com/questions/8986709/how-to-install-lessc-and-nodejs-in-a-python-virtualenv
NODEJS="http://nodejs.org/dist/v0.8.3/node-v0.8.3.tar.gz"