Skip to content

Instantly share code, notes, and snippets.

View sirgalleto's full-sized avatar
💛
JavaScript de libre pastoreo

Sebastián Osorio sirgalleto

💛
JavaScript de libre pastoreo
View GitHub Profile
@sirgalleto
sirgalleto / local.laziload.js
Last active January 22, 2017 11:38
Localize
let dictionary = {
es: {
welcome: 'Bienvenido!'
},
en: {
welcome: 'Welcome!'
}
};
function localize(){
@sirgalleto
sirgalleto / index.html
Last active September 13, 2016 21:41
Cat clicker for udacity javascript patterns course
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Cat clicker</title>
</head>
<body id="body">
<script src="index.js"></script>
</body>
@sirgalleto
sirgalleto / keybase.md
Created September 14, 2016 18:25
keybase.md

Keybase proof

I hereby claim:

  • I am sirgalleto on github.
  • I am sirgalleto (https://keybase.io/sirgalleto) on keybase.
  • I have a public key whose fingerprint is 4B78 4602 3D15 BE95 AAEC 06AF 6255 1ACF D6E1 8B27

To claim this, I am signing this object:

@sirgalleto
sirgalleto / email.model.ts
Created October 9, 2016 04:03
Model example
/* tslint:disable */
export interface EmailInterface {
to: string;
from: string;
subject: string;
text?: string;
html?: string;
id?: number;
}
@sirgalleto
sirgalleto / index.html
Created October 14, 2016 21:29
Chrome render fail
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>
Hello
</title>
<style media="screen">
body {
background-color: #ffb949;
@sirgalleto
sirgalleto / hosts
Last active October 21, 2016 20:06
github hosts
# /etc/hosts
192.30.253.112 http://github.com
192.30.253.119 http://gist.github.com
151.101.44.133 http://assets-cdn.github.com
@sirgalleto
sirgalleto / sizes.js
Created October 30, 2016 23:56
react-native responsive
import { Dimensions } from 'react-native';
export const { height, width } = Dimensions.get('window');
const ratioX = width <= 375 ? (width <= 320 ? 0.75 : 0.875) : 1 ;
const ratioY = height <= 568 ? (height <= 480 ? 0.75 : 0.875) : 1 ;
const base_unit = 16;
const unit = base_unit * ratioX;
// Write a function that receives an integer and returns its string representation
// 1 -> Uno
// 12 -> Doce
// 17 -> Diecisiete // Diez y siete
// 23 -> Veintitres
// 57 -> Cincuenta y siete
// 158 -> Ciento cincuenta y ocho
// 2347 -> Dos mil trescientos cuarenta y siete
// 0 < n < 10,000 (1-9999)
@sirgalleto
sirgalleto / uid.js
Created November 16, 2016 00:20
UID 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' format
_uid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8);
return v.toString(16);
});
}
@sirgalleto
sirgalleto / Auth.js
Created December 19, 2016 19:11
Authorization + Rest interactions for react-native
import { AsyncStorage } from 'react-native';
import EventEmmiter from 'EventEmitter';
import { apiRouter } from './services';
import { headers, access } from '../constants';
export class Auth extends EventEmmiter{
key = '@gos3s1on';
constructor() {