Skip to content

Instantly share code, notes, and snippets.

View hectorddmx's full-sized avatar

Hector De Diego hectorddmx

View GitHub Profile
@hectorddmx
hectorddmx / thumb_gen.py
Created August 2, 2011 08:04
How to generate thumbnails from existing jpg image files.
import glob
import Image
# HDB: set preferences here
source_extension = "*.jpg"
size = 110, 80
prefix = "t"
target_extension = "JPEG"
# get all the jpg files from the current folder
@hectorddmx
hectorddmx / calendar.py
Created August 2, 2011 09:19
This was a test I had some years ago, I used it as motivation to learn Python basics.
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""Prints a calendar by month, the user provides the year in a four digit format
and the month.
Exported Classes:
MonthCalendar - Formats and does the calculations for the CLI output of the
calendar
Cli - Recieves the data input and validates it
@hectorddmx
hectorddmx / ChromebookCapslock.ahk
Created February 6, 2012 06:11
Make your capslock work like the chromebook.
; Sends Ctrl + t whenever you press capslock
Capslock::^t
@hectorddmx
hectorddmx / hosts
Created February 24, 2012 01:26
hosts file for distracted people
## start-gsd
127.0.0.1 infoq.com
127.0.0.1 www.infoq.com
127.0.0.1 youtube.com
127.0.0.1 www.youtube.com
127.0.0.1 friendster.com
127.0.0.1 www.friendster.com
127.0.0.1 myspace.com
127.0.0.1 www.myspace.com
127.0.0.1 hi5.com
@hectorddmx
hectorddmx / dabblet.css
Created November 13, 2012 19:28
Untitled
body {background: #000;}
div {padding: 5px; color: #fff;}
.sicomoro {background: #a98c3e;}
.rosa_cardenal {background: #9b0556; }
.tangerine{background: #da9100; }
.san_marino{background: #3e5ba9;}
@hectorddmx
hectorddmx / dabblet.css
Created April 11, 2013 15:54
Hola en azul
/**
* Hola en azul
*/
html {
color: #EED89C;
font-size: 1.5em;
background: black;
min-height: 100%;
font-family: Futura, Futura-Medium, "Futura Medium", "Century Gothic", CenturyGothic, "Apple Gothic", AppleGothic, "URW Gothic L", "Avant Garde", sans-serif;
}
@hectorddmx
hectorddmx / dabblet.css
Created April 11, 2013 15:54
Hola en azul
/**
* Hola en azul
*/
html {
color: #EED89C;
font-size: 1.5em;
background: black;
min-height: 100%;
font-family: Futura, Futura-Medium, "Futura Medium", "Century Gothic", CenturyGothic, "Apple Gothic", AppleGothic, "URW Gothic L", "Avant Garde", sans-serif;
}
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@hectorddmx
hectorddmx / fjord.py
Last active March 9, 2017 18:11
If you ever need to print all your project files, use this script to join them in a single .txt file.
import fire
import os
from glob import glob
import subprocess
class Fjord(object):
def __init__(self, project_path, file_types, output_path, output_filename):
@hectorddmx
hectorddmx / detect-js-framework.js
Created December 6, 2017 23:04 — forked from rambabusaravanan/detect-js-framework.js
Detect JS Framework used in a Website
// Pase these lines into website's console ( Ctrl/Cmd + Shift + I )
if(!!window.React ||
!!document.querySelector('[data-reactroot], [data-reactid]'))
console.log('React.js');
if(!!window.angular ||
!!document.querySelector('.ng-binding, [ng-app], [data-ng-app], [ng-controller], [data-ng-controller], [ng-repeat], [data-ng-repeat]') ||
!!document.querySelector('script[src*="angular.js"], script[src*="angular.min.js"]'))
console.log('Angular.js');