Skip to content

Instantly share code, notes, and snippets.

View vic's full-sized avatar
🤮
puke nuke

Victor Borja vic

🤮
puke nuke
View GitHub Profile
@vic
vic / index.html
Created June 2, 2015 19:00
Framework7 router.back bug?
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="bower_components/framework7/dist/css/framework7.css">
<link rel="stylesheet" href="bower_components/framework7/dist/css/framework7.themes.css">
</head>
<body>
@vic
vic / elfos.rb
Created March 5, 2015 03:18
Elfos que aprenden a escribir y morir por convivir con los humanos.
module Aliveness
attr_accessor :alive
def initialize
@alive = true
end
end
module DieAbility
include Aliveness
@vic
vic / index
Created March 4, 2015 20:01
Angular example
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script src="script.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body ng-app="stories" >
@vic
vic / index.html
Created February 23, 2015 22:34
angular editable choices
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script>
var foo = {
choices: ['uno', 'dos']
};
@vic
vic / README
Last active August 29, 2015 14:15
Patos as a service
Patos demo
How to serve:
`python -m SimpleHTTPServer`
open http://localhost:8000
@vic
vic / designer.html
Created August 13, 2014 03:29
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
@vic
vic / atl.html
Created December 19, 2013 12:59
<html>
<head>
<script type='text/javascript'>
+(function(undefined){
var Acute = function(){
}
var TEXT_PLACEHOLDER_RE = /\{\{[\w\.]+\}\}/
@vic
vic / search.json
Created November 2, 2013 00:20
foo bar baz
{
"query": {
"bool": {
"must": [
{
"terms": {
"baz_id": [
6
@vic
vic / gist:6136967
Created August 2, 2013 01:57
find_nearest point
function rad(x) {return x*Math.PI/180;}
function find_nearest(my_position, points) {
var lat = my_position[0];
var lng = my_position[1];
var R = 6371; // radius of earth in km
var distances = [];
var closest = null;
for( i=0;i<points.length; i++ ) {
var mlat = points[i][0];
DROP FUNCTION IF EXISTS levenshtein;
DELIMITER $$
CREATE FUNCTION `levenshtein`( s1 text, s2 text) RETURNS int(11)
DETERMINISTIC
BEGIN
DECLARE s1_len, s2_len, i, j, c, c_temp, cost INT;
DECLARE s1_char CHAR;
DECLARE cv0, cv1 text;
SET s1_len = CHAR_LENGTH(s1), s2_len = CHAR_LENGTH(s2), cv1 = 0x00, j = 1, i = 1, c = 0;
IF s1 = s2 THEN