Skip to content

Instantly share code, notes, and snippets.

View heanfig's full-sized avatar
🏠
Working from home

Herman Andres Figueroa heanfig

🏠
Working from home
View GitHub Profile
@heanfig
heanfig / lodash.html
Created January 17, 2016 04:26
lodash implementacion basica
<html>
<head>
<title>Lodash mis primeros pasos</title>
</head>
<body>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.2.0.min.js"></script>
<script type="text/javascript" src="https://raw.githubusercontent.com/lodash/lodash/4.0.0/dist/lodash.min.js"></script>
<div id="salida">
</div>
<script type="text/html" id="template">
@heanfig
heanfig / fileexternal.html
Created May 16, 2016 05:39
Open external link using phonegap
<gap:plugin name="org.apache.cordova.inappbrowser" version="0.6.0" />
<a href="#" onclick="window.open('http://design.ubuntu.com/wp-content/uploads/ubuntu-logo32.png', '_system', 'location=no'); return false;">_system</a>
@heanfig
heanfig / search.js
Created June 1, 2016 06:30
load remote query typeahead
var states = new Bloodhound({
datumTokenizer: function(d) { return Bloodhound.tokenizers.whitespace(d.num); },
queryTokenizer: Bloodhound.tokenizers.whitespace,
remote: {
url: Metronic.getAJAXURL() + "general/general/BuscarCiudades?query=%QUERY",
filter: function (ciudades) {
return $.map(ciudades, function (ciudad) {
return {
num: ciudad.id_ciudad,
nombre: ciudad.ciudad_nombre.toLowerCase(),
@heanfig
heanfig / app.js
Created June 23, 2016 17:07 — forked from gcoop/app.js
Basic example of using the accelerometer in Appcelerator's Titanium Mobile.
// Create tab group
var tabGroup = Titanium.UI.createTabGroup({
barColor: "black"
});
// Create home tab.
var win = Ti.UI.createWindow({
title: "Record"
});
// Tab for the recording pane.
@heanfig
heanfig / ShakeListener.java
Created July 14, 2016 04:01
shake listener in java
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorListener;
import android.hardware.SensorManager;
import android.util.Log;
import android.widget.Toast;
import android.content.Context;
import java.lang.UnsupportedOperationException;
<script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" data-source="mautic"></script>
<script data-source="mautic">
var OneSignal = OneSignal || [];
OneSignal.push(["init", {
appId: "27787d27-d2fd-4492-9265-580124367491",
safari_web_id: "",
subdomainName: 'https://inboundfelicident.onesignal.com',
@heanfig
heanfig / modal.js
Last active February 3, 2017 02:39
Modal Override
//Remover el modal
function removeModal( hasPerspective ) {
classie.remove( modal, 'ecp-show' );
if( hasPerspective ) {
classie.remove( document.documentElement, 'ecp-perspective' );
}
}
function removeModalHandler() {
@heanfig
heanfig / LinkedList.js
Created February 24, 2017 14:48 — forked from wesleyhales/LinkedList.js
JavaScript LinkedList Example
//I wanted a more elegant linkedlist example than the others, so purely for academic purposes I created one.
var LinkedList = function(e){
var that = {}, first, last;
that.push = function(value){
var node = new Node(value);
if(first == null){
first = last = node;
/*
Given two words, beginWord and endWord, and a wordlist of approved words, find the length of the shortest transformation sequence from beginWord to endWord such that:
Only one letter can be changed at a time
Each transformed word must exist in the wordList.
Return the length of the shortest transformation sequence, or 0 if no such transformation sequence exists.
Note: beginWord does not count as a transformed word. You can assume that beginWord and endWord are not empty and are not the same.
Example
@heanfig
heanfig / user.sql
Created March 1, 2017 16:57 — forked from drmmr763/user.sql
mautic user
INSERT INTO `users` (`id`, `role_id`, `is_published`, `date_added`, `created_by`, `created_by_user`, `date_modified`, `modified_by`, `modified_by_user`, `checked_out`, `checked_out_by`, `checked_out_by_user`, `username`, `password`, `first_name`, `last_name`, `email`, `position`, `timezone`, `locale`, `last_login`, `last_active`, `online_status`, `preferences`)
VALUES
(2, 1, 1, '2015-04-01 15:15:07', 1, 'Nobody', NULL, NULL, NULL, NULL, NULL, NULL, 'madmin', '$2y$13$VkE7UjFetqAM13oT4v/VYOfRCGrJ4hbr0zuwRZo6KVfDnNb16WFwy', 'Administrator', 'Uuser', 'user@local.host', NULL, NULL, NULL, NULL, NULL, 'offline', 'N;');