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 / 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 / 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 / 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 / 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 / command_line_tricks.md
Last active August 29, 2015 14:27
Nice command line tricks

Show just the commits done to a git branch, when this branch has been already merged into master/develop

git log mybranch --not $(git for-each-ref --format='%(refname)' refs/heads/ | grep -v "refs/heads/mybranch")

Vim automatically adds a newline character at the end of a file, and this causes git diff showing it. We can get rid of this character by doing this

perl -pi -e 'chomp if eof' filename
@jorgeas80
jorgeas80 / validate_password.py
Created February 17, 2015 10:00
Python function to validate a password string
import re
# Taking from https://gist.github.com/psjinx/5722079#file-utils-py
MINIMUM_PASSWORD_LENGTH = 8
REGEX_VALID_PASSWORD = (
## Don't allow any spaces, e.g. '\t', '\n' or whitespace etc.
r'^(?!.*[\s])'
## Check for a digit
'((?=.*[\d])'
## Check for an uppercase letter
@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 / odyssey.html
Last active August 29, 2015 14:12
Articulo de Yorokobu CartoDB-ficado
<!doctype><html><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Odyssey.js Slides</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="http://cartodb.github.io/odyssey.js/sandbox/favicon.png">
<link rel="icon" type="image/png" href="http://cartodb.github.io/odyssey.js/sandbox/favicon.png">
@jorgeas80
jorgeas80 / index.html
Last active August 29, 2015 14:11
#Hackgriculture map. Shows tweets containing #hackgriculture / hackgriculture and allows clicking on them
<!DOCTYPE html>
<html>
<head>
<title>#Hackgriculture</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/3.11/themes/css/cartodb.css" />
<style>
html, body, #map {