Skip to content

Instantly share code, notes, and snippets.

View leopic's full-sized avatar

Leo Picado leopic

View GitHub Profile
@ZevEisenberg
ZevEisenberg / resetAllSimulators.sh
Last active December 23, 2024 19:57
Reset all iOS simulators with this one weird trick
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all
@anaimi
anaimi / Serializable.swift
Created July 9, 2014 03:51
Serialize a Swift object to JSON or Dictionary, with selective properties.
/*
Purpose:
Convert (or Serialize) an object to a JSON String or Dictionary.
Usage:
Use 'Serialize.toJSON' on instances of classes that:
- Inherit from NSObject
- Implement 'Serializable' protocol
- Implement the property 'jsonProperties' and return an array of strings with names of all the properties to be serialized
// TODO: filtro?
crear y destruir los ingredientes
var ingredientes = '2@Tazas de arroz; 3@Aguacates mexicanos; 1@Banano en rodajas;',
separadorIngredientes = ';',
separadorCantidades = '@';
var separados = _.map(_.compact(ingredientes.split(separadorIngredientes)), function(ingArr) {
var tmp = ingArr.trim().split(separadorCantidades);
return {
cantidad: parseInt(_.first(tmp), 10),
@albemuth
albemuth / inUrl.js
Last active December 23, 2015 18:49 — forked from leopic/inUrl.js
_.mixin({
inUrlDry: function(singleParam) {
//en vez de usar un arreglo para manegar los keys, vals se crea un map, así
//se puede accesar directamente en vez de tener que buscar con index of,
//esa parte pasa de O(n) a O(1) primero se hace un arreglo que tiene una
//estructura así: [[param, {decodedValue: 'val', rawValue: 'val'}]...] y el
//metodo _.object pasa de eso a
//{param: {decodedValue: 'val', rawValue: 'val'}}
var paramMap = _.chain(location.search.slice(1).split('&'))
@farandal
farandal / gist:6144701
Created August 3, 2013 01:34
Translated default messages for the jQuery validation plugin. Spanish
/*
* Translated default messages for the jQuery validation plugin.
* Locale: ES
*/
jQuery.extend(jQuery.validator.messages, {
required: "Este campo es obligatorio.",
remote: "Por favor, rellena este campo.",
email: "Por favor, escribe una dirección de correo válida",
@leopic
leopic / order.txt
Created September 25, 2012 17:06
CSSComb property list
@extend
@include
animation
animation-delay
animation-direction
animation-duration
animation-iteration-count
animation-name
animation-play-state
animation-timing-function
<html>
<head>
<title>js test</title>
</head>
<body>
<h1>leo</h1>
</body>
<script>
console.log('---');
// 0: what's printed here?
@paulmillr
paulmillr / active.md
Last active March 17, 2025 08:21
Most active GitHub users (by contributions). https://paulmillr.com

Most active GitHub users (git.io/top)

The list would not be updated for now. Don't write comments.

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Because of GitHub search limitations, only 1000 first users according to amount of followers are included. If you are not in the list you don't have enough followers. See raw data and source code. Algorithm in pseudocode:

githubUsers
@kmiyashiro
kmiyashiro / admin.html
Created May 10, 2012 21:02
Mocha HTML spec
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="../libs/mocha.css" type="text/css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<div id="mocha"></div>
<script src="../libs/mocha.js" type="text/javascript" charset="utf-8"></script>
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"