Skip to content

Instantly share code, notes, and snippets.

View shvelo's full-sized avatar

Nikoloz Shvelidze shvelo

View GitHub Profile
@shvelo
shvelo / 2years.log
Created June 17, 2012 20:19
output of generator
Year: 2012
Name: Sim Hill
Population: 269
Mayor: Steve Lombardi Sr.
Map:
█░░██░░█░██░░░█░█░█░░░░█░██████░░█░░█░
█░░█░█░░░███░░██░█████░░█░░█░░█████░█░
█████░█░██░░███░░░░░███░░█░█░██░░█░░░░
██░░░█░█░█░░░░██░█░░░█░░░██░██░██░██░█
░░░█░███████████░░██░█░█████░█░█░░░░██
@shvelo
shvelo / gist:4749455
Last active December 12, 2015 09:09
Quick notepad, paste in your address bar and go
data:text/html, <html contenteditable><title>Notepad</title><body style="padding:1em;font-family:sans-serif;color: #2d2d2d;font-size:1.5em">
@shvelo
shvelo / load_jquery.js
Last active December 16, 2015 01:19
Load jQuery on any page
var s = document.createElement('script');
s.src = "http://code.jquery.com/jquery-latest.min.js";
document.body.appendChild(s);
@shvelo
shvelo / Clock.pde
Created June 20, 2013 16:29
Arduino Mega2560 | Library: https://github.com/rodan/ds3231 | Pins: SDA to Pin20 | SCL to Pin21 | VCC to 5v | GND to GND |
// include the library code:
#include <LiquidCrystal.h>
#include <Wire.h>
#include "ds3231.h"
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int sensorValue;
@shvelo
shvelo / gist:7563808
Last active December 28, 2015 21:19
Get distribution name from shell
grep -Po "DISTRIB_ID=(\K.*)" /etc/lsb-release
@shvelo
shvelo / Mario.ino
Last active December 30, 2015 12:29 — forked from gskielian/Mario.ino
int spk = 0;
void setup() {}
void loop() {
tone(spk,660,100);
delay(150);
tone(spk,660,100);
delay(300);
tone(spk,660,100);
@shvelo
shvelo / source.js
Last active August 29, 2015 13:56
Replace Body content with HTML source
(function(){
var code_container = document.createElement("div");
code_container.id = "code_container";
code_container.innerText = document.documentElement.innerHTML;
code_container.innerHTML = "<pre><code>"+ code_container.innerHTML + "</code></pre>";
document.body.appendChild(code_container);
// More at https://github.com/isagalaev/highlight.js/tree/master/src/styles
@shvelo
shvelo / gradle.properties
Created June 6, 2014 10:01
Faster Gradle builds
org.gradle.daemon=true
org.gradle.configureondemand=true
org.gradle.parallel=true
@shvelo
shvelo / download-all-files.js
Last active August 29, 2015 14:07
Download all images on page. (dangerous, can open shit ton of windows)
var downloadLink = document.createElement('a');
downloadLink.download = true;
for(i in document.images) { downloadLink.href = document.images[i].src; downloadLink.click() };
@shvelo
shvelo / netuse.sh
Last active August 29, 2015 14:13
Network interface usage in kb/s in format down,up every 3 seconds. usage: ./netuse.sh <interface>
#!/bin/bash
delay=3
while true; do
mon_total_down_old=$(cat /proc/net/dev | grep $1 | awk '{print $2}')
mon_total_up_old=$(cat /proc/net/dev | grep $1 | awk '{print $10}')
sleep 1
mon_total_down=$(cat /proc/net/dev | grep $1 | awk '{print $2}')
mon_total_up=$(cat /proc/net/dev | grep $1 | awk '{print $10}')