Skip to content

Instantly share code, notes, and snippets.

View mihai-vlc's full-sized avatar

Mihai Ionut Vilcu mihai-vlc

View GitHub Profile
import subprocess
mysql = '/wamp/bin/mysql/mysql5.6.12/bin/mysql.exe'
host = 'localhost'
dbname = 'test'
user = 'root'
passwd = ''
query = 'SELECT `text` FROM `tbt`'
/**
* Author: Vilcu Mihai Ionut
* Bilet: CC44
*/
import java.util.*;
import java.lang.*;
class tmp
(function(o) {
o = o || {};
// The function existy is meant to define the existence of something.
o.existy = function existy(x) { return x != null };
o.truthy = function truthy(x) { return (x !== false) && o.existy(x) };
o.doWhen = function(cond, action) { if(o.truthy(cond)) return action(); return undefined; };
/**
* Script shows position and size of selection or layer if selection is not set
* @author: Mihai Ionut Vilcu
* Jul 2014
*/
/******** CONFIGURATION **********/
var ID = '#home-tab-item-'; // the css selector
var PATH = '~/Desktop/test.css';
@mihai-vlc
mihai-vlc / settings.js
Created March 14, 2014 17:29
JSBin settings
{"panels":["html","css","live"],"editor":{"theme":"monokai","styleActiveLine":false,"lineNumbers":true},"includejs":false,"font":14,"addons":{"closebrackets":true,"highlight":true,"vim":true,"emacs":false,"trailingspace":false,"fold":true}}
@mihai-vlc
mihai-vlc / conEmu.xml
Created January 21, 2014 20:48
ConEmu settings
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2014-01-21 22:47:08" build="131223">
<value name="ColorTable00" type="dword" data="0036342e"/>
<value name="ColorTable01" type="dword" data="00a46534"/>
<value name="ColorTable02" type="dword" data="00069a4e"/>
<value name="ColorTable03" type="dword" data="009a9806"/>
<value name="ColorTable04" type="dword" data="000000cc"/>
<value name="ColorTable05" type="dword" data="007b5075"/>
@mihai-vlc
mihai-vlc / dabblet.css
Created December 29, 2013 21:54
Untitled
progress {
margin: 40px;
width: 75%;
height: 1em;
-webkit-appearance: none;
appearance: none;
}
progress::-webkit-progress-bar {
background: #ccc;
@mihai-vlc
mihai-vlc / gitignore
Last active December 28, 2015 13:09 — forked from philsinatra/gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.sass-cache
@mihai-vlc
mihai-vlc / toggle.js
Created November 8, 2013 13:46
JavaScript: Toogle text generalized
$(".toggle-text").on('click', function(event) {
event.preventDefault();
$this = $(this);
var text = JSON.parse(($this.attr('data-toggle-text')));
var current_text = $this.text();
for (var i = 0; i < text.length; i++) {
if(i == text.length-1){ // if it's the last one set it the first value
$this.text(text[0]);
break;
@mihai-vlc
mihai-vlc / safari.js
Created November 4, 2013 09:38
JavaScript: detect safari
var ua = navigator.userAgent.toLowerCase();
var isSafari = ((ua.indexOf('safari')!=-1) && (ua.indexOf('chrome') == -1));