Skip to content

Instantly share code, notes, and snippets.

@elmarcoh
elmarcoh / rbx_telegram_dark.css
Created Jan 9, 2020
Dark mode for Telegram on Rambox (paste in "custom script")
View rbx_telegram_dark.css
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 Feb 1, 2020
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
View rambox_whatsapp_dark.css
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:
View esp8266.ino
#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 Aug 19, 2015
List number of commits that are not in develop
View git_list_commits_to_develop.sh
for b in `git branch --remote`; do echo $b `git lg origin/develop..$b|wc -l` ; done
@elmarcoh
elmarcoh / game.sh
Created Mar 24, 2014
Run a game with wine using only one monitor (on multimonitor setup)
View game.sh
#!/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 Oct 31, 2017
Selenium + Browsermob proxy example
View selenium_proxy.py
"""
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
View gist:7594544
░░░░░░░░░▄░░░░░░░░░░░░░░▄░░░░
░░░░░░░░▌▒█░░░░░░░░░░░▄▀▒▌░░░
░░░░░░░░▌▒▒█░░░░░░░░▄▀▒▒▒▐░░░
░░░░░░░▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐░░░
░░░░░▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐░░░
░░░▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌░░░
░░▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒▌░░
░░▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐░░
░▐░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄▌░
░▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒▌░
@elmarcoh
elmarcoh / pair_generator.html
Created Oct 19, 2013
A dumb app to generate pairs for XP, useful for lazy rehashing
View pair_generator.html
<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 Aug 16, 2013
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.
View grabssh
#!/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 Dec 10, 2012
Install node & npm in virtualenv
View install_node.sh
#!/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"