Skip to content

Instantly share code, notes, and snippets.

View jorgeas80's full-sized avatar
🎯
Focusing

Jorge Arévalo jorgeas80

🎯
Focusing
View GitHub Profile
@jorgeas80
jorgeas80 / logging_level.py
Created October 12, 2015 14:20
Logging level trick in Python
# Trick from https://www.reddit.com/r/Python/comments/3nctlm/what_python_tools_should_i_be_using_on_every
# The logging levels are actually integers with a 10 increment (DEBUG is 10, CRITICAL is 50)
parser.add_argument('-v', '--verbose', action='count', default=0)
parser.add_argument('-q', '--quiet', action='count', default=0)
logging_level = logging.WARN + 10*args.quiet - 10*args.verbose
# script -vv -> DEBUG
# script -v -> INFO
# script -> WARNING
@jorgeas80
jorgeas80 / makeRadiosDeselectableByName.js
Created December 29, 2015 14:57
Make radio button deselectable
var makeRadiosDeselectableByName = function(name){
$('input[name=' + name + ']').click(function() {
if($(this).attr('previousValue') == 'true'){
$(this).attr('checked', false)
} else {
$('input[name=' + name + ']').attr('previousValue', false);
}
$(this).attr('previousValue', $(this).attr('checked'));
});
@jorgeas80
jorgeas80 / app.css
Last active January 28, 2016 16:43
html, body, #map {
height: 100%;
padding: 0;
margin: 0;
}
.header {
position: absolute;
padding: 40px;
top: -35px;
@jorgeas80
jorgeas80 / bs-container
Created February 26, 2016 18:02
My code snippets for Brackets (created using https://github.com/zaggino/brackets-snippets)
<div class="container{{$1?:optionalClasses}}">
{{!cursor}}
</div>
@jorgeas80
jorgeas80 / brackets-plugins.md
Last active March 7, 2016 22:30
Brackets plugins I use

Those are the plugins I use in Brackets editor, in alphabetical order

@jorgeas80
jorgeas80 / LINKS_BOOTSTRAP.md
Last active March 21, 2016 12:59
Enlaces curso Bootstrap
@jorgeas80
jorgeas80 / gist:62fa5145f2eb6ab1192f7b4905b4c9e4
Created April 12, 2016 11:09 — forked from jimbojsb/gist:1630790
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

<?php
// get the HTTP method, path and body of the request
$method = $_SERVER['REQUEST_METHOD'];
$request = explode('/', trim($_SERVER['PATH_INFO'],'/'));
$input = json_decode(file_get_contents('php://input'),true);
// connect to the mysql database
$link = mysqli_connect('localhost', 'user', 'pass', 'dbname');
mysqli_set_charset($link,'utf8');
@jorgeas80
jorgeas80 / parser.py
Created July 5, 2016 21:07 — forked from JSONOrona/parser.py
Python command line argument example using argparse module
#!/usr/bin/python
''' Python command line argument example using argparse module
Example output:
./parser.py --server=pyserver --port=8080,443,25,22,21 --keyword=pyisgood
Server name: [ pyserver ]