Skip to content

Instantly share code, notes, and snippets.

View shvelo's full-sized avatar

Nikoloz Shvelidze shvelo

View GitHub Profile
@zaius
zaius / background.sh
Created January 16, 2011 23:29
How to redirect a running process output to a file and log out
ctrl-z
bg
touch /tmp/stdout
touch /tmp/stderr
gdb -p $!
# In GDB
p dup2(open("/tmp/stdout", 1), 1)
p dup2(open("/tmp/stderr", 1), 2)
@defunkt
defunkt / gitio
Created September 11, 2011 08:11
Turn a github.com URL into a git.io URL.
#!/usr/bin/env ruby
# Usage: gitio URL [CODE]
#
# Turns a github.com URL
# into a git.io URL
#
# Copies the git.io URL to your clipboard.
url = ARGV[0]
code = ARGV[1]
@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 */
@justinbmeyer
justinbmeyer / jsmem.md
Last active June 29, 2024 16:00
JS Memory

JavaScript Code

var str = "hi";

Memory allocation:

Address Value Description
...... ...
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 })
@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);
@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 / 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
@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?"))