Skip to content

Instantly share code, notes, and snippets.

View shvelo's full-sized avatar

Nikoloz Shvelidze shvelo

View GitHub Profile
@shvelo
shvelo / steamfix.sh
Last active June 22, 2016 19:31
Fix Steam not running on new Linux libraries
#!/bin/bash
find ~/.steam/root/ -name "libgcc_s.so*" -print -delete
find ~/.steam/root/ -name "libstdc++.so*" -print -delete
find ~/.steam/root/ -name "libxcb.so*" -print -delete
find ~/.steam/root/ -name "libgpg-error.so*" -print -delete
@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}')
@safareli
safareli / gicrostaticAI.md
Last active August 29, 2015 14:10
გიკროსტატიკური ხელოვნური ინტელექტი

ამ ბოლო დროს მეგობრებს ღამეები აღარ გვძინავს და ვმუშაობდით ხელოვნური ინტელექტის ერთ გიკროსტიკურტ პროეტზე რომლის ფარგლებშიც შევქმენით ეს bookmarklet * ის დაგეხმარებათ ნებისმიერ კითხვაზე იპოვოთ პასუხი :3

javascript:var _a = document.location.href = "https://www.google.ge/#q="+encodeURIComponent(prompt("what you want?"))

ps. თუ არ იცით რაარის bookmarklet და გაინტერესებთ დააწექით F12 შემდეგ გადადით კონსოლში და ჩაწერეთ ეს :

document.location.href = "https://www.google.ge/#q="+encodeURIComponent(prompt("what you want?"))
@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 / 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);
@gskielian
gskielian / Mario.ino
Created August 1, 2013 21:44
Mario Theme in Arduino: )
tone(9,660,100);
delay(150);
tone(9,660,100);
delay(300);
tone(9,660,100);
delay(300);
tone(9,510,100);
delay(100);
tone(9,660,100);
delay(300);
@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);
var q = azureClient.getTable('clientDevices').select('_count').where({ isActive: true })
if (filters.deviceModel && filters.deviceModel.length > 0) q.where(function(arr) { return this.deviceModel in arr }, filters.deviceModel)
if (filters.deviceOsVersion && filters.deviceOsVersion.length > 0) q.where(function(arr) { return this.deviceOsVersion in arr }, filters.deviceOsVersion)
if (filters.appVersion && filters.appVersion.length > 0) q.where(function(arr) { return this.appVersion in arr }, filters.appVersion)
if (filters.languageCode && filters.languageCode.length > 0) q.where(function(arr) { return this.languageCode in arr }, filters.languageCode)
if (filters.countryCode && filters.countryCode.length > 0) q.where(function(arr) { return this.countryCode in arr }, filters.countryCode)
q.where({ isDevMode: (filters.isDevMode) ? true : false })
@justinbmeyer
justinbmeyer / jsmem.md
Last active August 19, 2022 04:50
JS Memory

JavaScript Code

var str = "hi";

Memory allocation:

Address Value Description
...... ...
@scotu
scotu / solarized.css
Created October 8, 2011 18:27 — forked from tdreyno/solarized.css
Solarized Light Pygments CSS
.highlight { background-color: #ffffcc }
.highlight .c { color: #586E75 } /* Comment */
.highlight .err { color: #93A1A1 } /* Error */
.highlight .g { color: #93A1A1 } /* Generic */
.highlight .k { color: #859900 } /* Keyword */
.highlight .l { color: #93A1A1 } /* Literal */
.highlight .n { color: #93A1A1 } /* Name */
.highlight .o { color: #859900 } /* Operator */
.highlight .x { color: #CB4B16 } /* Other */
.highlight .p { color: #93A1A1 } /* Punctuation */