Skip to content

Instantly share code, notes, and snippets.

View hectorddmx's full-sized avatar

Hector De Diego hectorddmx

View GitHub Profile
@hectorddmx
hectorddmx / Fonts.swift
Created April 23, 2018 04:58 — forked from feighter09/Fonts.swift
Set global font for iOS app in one place
// MARK: - Swizzling
extension UIFont {
class var defaultFontFamily: String { return "Georgia" }
override public class func initialize()
{
if self == UIFont.self {
swizzleSystemFont()
}
}
@hectorddmx
hectorddmx / install_pyenv.sh
Created April 8, 2018 23:43 — forked from ysaotome/install_pyenv.sh
pyenv install for CentOS 6.5 x86_64
#!/bin/zsh
# pyenv install for CentOS 6.5 x86_64
yum install -y gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel
git clone git://github.com/yyuu/pyenv.git ~/.pyenv
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
@hectorddmx
hectorddmx / run phoenix on amazon linux.sh
Last active March 9, 2018 05:43 — forked from eikes/run phoenix on amazon linux.sh
run phoenix on amazon linux
export LANG="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
cd /
# app deps
yum install git -y
# erlang deps
@hectorddmx
hectorddmx / Elixir Email Validation
Last active March 8, 2018 07:14 — forked from mgamini/Elixir Email Validation
Elixir Email Validation
defmodule EmailValidator do
# ensure that the email looks valid
def validate_email(email) when is_binary(email) do
case Regex.run(~r/^[A-Za-z0-9._%+-+']+@[A-Za-z0-9.-]+\.[A-Za-z]+$/, email) do
nil ->
{:error, "Invalid email"}
[email] ->
try do
Regex.run(~r/(\w+)@([\w.]+)/, email) |> validate_email
@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');
@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):
# 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 / 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;
}
@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;}