Skip to content

Instantly share code, notes, and snippets.

View m4rky77's full-sized avatar

Marcos Reynoso m4rky77

  • Azertyva
  • Buenos Aires, Argentina
View GitHub Profile
@dfurber
dfurber / templates.coffee
Created June 13, 2011 20:05
Javascript Template Rendering Engine
# Template rendering in JS
# Combines John Resig's simple js templates with Sproutcore's content binding concept.
# Define your templates in the templates array (or rewrite it to work however you like!)
#
# To render a template to an html string, call:
# render('example', dataObject)
# OR
# render('example', arrayOfDataObjects)
# OR if you have template that isn't bound to a data object:
# render('static_example')
@edwardtoday
edwardtoday / gist:2204864
Created March 26, 2012 12:54
PhoneGap sqlite working example
Hi
I hope this helps you all get started with phonegap and sqlite in your
application
Dean-O
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
@deanet
deanet / google.sh
Created August 22, 2012 16:09
Uploading File into Google Drive (because grive too many dependencies qt, xorg ? )
#!/bin/bash
## uploading to google
## rev: 22 Aug 2012 16:07
det=`date +%F`
browser="Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:13.0) Gecko/20100101 Firefox/13.0.1"
username="user@domain-apps.com"
password="password"
accountype="HOSTED" #gooApps = HOSTED , gmail=GOOGLE
@thomasnordlund
thomasnordlund / authRoute.js
Created November 6, 2012 16:19 — forked from xcambar/LICENSE
Authenticated routing using AngularJS
authRouteProvider.$inject = ['$routeProvider'];
function authRouteProvider ($routeProvider) {
/**
* Creates a controller bound to the route, or wraps the controller in param
* so the authentication check is run before the original controller is executed
* @param currentController
* @return {Function} The wrapper controller
*/
function redirectCtrlFactory (currentController) {
_ctrl.$inject = ['currentUser__', 'userRole__', '$location'];
@jeefy
jeefy / phonegap_orm.js
Last active December 19, 2023 21:26
Rough ORM on top of PhoneGap's Storage API.
/*
I wasn't happy with PhoneGap's Storage API and made it cleaner (in my eyes anyway)
Example:
db.query("someTable", ['id', 'column1', 'column2'], false, function(tx, results){ .. });
db.query("someTable", ['*'], {'column1':'val', 'column2':'val'}, function(tx, results){ .. });
db.save("someTable", IterableObject, function(){ ... });
Doing more testing and validation later, but getting it out there now. :)
*/
@g0ody
g0ody / gist:5386237
Created April 15, 2013 06:59
Lawnchair Service for AngularJS
Services.factory("LawnchairFactory", function($window, $log, $parse) {
return function(name, config) {
var collection = {};
var array = [];
var isArray = config && config.isArray;
var idGetter = $parse((config && config.entryKey) ? config.entryKey : "id");
var transformSave = (config && config.transformSave) ? config.transformSave : angular.identity;
var transformLoad = (config && config.transformLoad) ? config.transformLoad : angular.identity;
function getEntryId(entry){
@dpwiz
dpwiz / controllers.js
Last active May 7, 2016 23:10
AngularJS + WebSocket + JSON RPC 2.0
function WSTestCtrl($scope, ws) {
$scope.method = 'ping'
$scope.params = '[]'
$scope.reply = 'None yet.'
$scope.reply_class = 'info'
$scope.go = function(){
ws.call($scope.method, JSON.parse($scope.params)).then(function(d){
$scope.reply = JSON.stringify(d)
@clouddueling
clouddueling / MainCtrl.js
Last active November 3, 2022 13:26
How to authenticate using AngularJS
controllers.controller('MainCtrl', function($scope, $location, Facebook, $rootScope, $http, $location, Upload, Auth, User, Question, Category, Serie, Record, Location, Popup, Process, Card, Question) {
$scope.$on('authLoaded', function() {
$scope.isExpert($scope.main.serieId);
$scope.isMember($scope.main.serieId);
});
$scope.loadAuth = function() {
Auth.load().success(function(data) {
$scope.main.user = data.user;
$scope.$broadcast("authLoaded");
@seti123
seti123 / map-controller (angular)
Last active December 23, 2015 00:39
Google Maps marker update from angular controller, iframe embedded in bootstrap tab (which cause normally "trouble" in repainting map
// this is snipped inside the angular controller, which got geo positions after loading data from a REST source ...
for (var i=0; i<list.length; i++)
{
var opts = {"title": list[i].title};
var marker={};
if (list[i].latitude && list[i].longitude )
{
// this is not a google marker, just save pos/title in an object
marker = {lat: list[i].latitude,
lon: list[i].longitude,
@nagydani
nagydani / ipfs_ethereum.txt
Created October 15, 2015 14:12
Integration of ipfs and Ethereum
In this document, I outline the tasks required for storing and
presenting the Ethereum block chain and Web-based Ethereum Đapps in
ipfs. Currently, ipfs is very good at locating and delivering content
using a global, consistent address space and it has a very well designed
and implemented http gateway. However, Ethereum's use cases require
additional capabilities that ipfs currently does not provide.
Redundancy and persistency