Skip to content

Instantly share code, notes, and snippets.

View brynner's full-sized avatar
😎
Hello World!

Brynner Ferreira brynner

😎
Hello World!
View GitHub Profile
@brynner
brynner / package.json
Last active June 26, 2017 17:50 — forked from franksmule/package.json
Package.json for the gulp.js file - Tutorial -> http://omcfarlane.co.uk/install-gulp-js-windows/
{
"name": "MeuProjeto",
"version": "1.0.0",
"dependencies": {
"gulp": "*",
"gulp-ruby-sass": "*",
"gulp-util": "*",
"gulp-rename": "*",
"map-stream": "*",
"gulp-livereload": "*",
@brynner
brynner / gulpfile.js
Created June 26, 2017 17:38 — forked from franksmule/gulpfile.js
gulp.js that does SASS, JS Concatenation Watching - Tutorial -> http://omcfarlane.co.uk/install-gulp-js-windows/
//*********** IMPORTS *****************
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var gutil = require('gulp-util');
var rename = require("gulp-rename");
var map = require("map-stream");
var livereload = require("gulp-livereload");
var concat = require("gulp-concat");
var uglify = require('gulp-uglify');
var watch = require('gulp-watch');
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <[email protected]>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
@brynner
brynner / LocalStorageExpires.js
Last active October 20, 2020 18:51
My solution to set a local cache with expiration, using HTML5 LocalStorage. This dramatically increases the performance of a mobile application.
/* Author: Brynner Ferreira (brynner.net) */
// Functions
function removeHtmlStorage(name) {
localStorage.removeItem(name);
localStorage.removeItem(name+'_time');
}
function setHtmlStorage(name, value, expires) {
if (expires==undefined || expires=='null') { var expires = 3600; } // default: 1h
var date = new Date();
var schedule = Math.round((date.setSeconds(date.getSeconds()+expires))/1000);
<?php
require_once('base_facebook.php');
require_once('facebook.php');
// Credentials
$fb_app_id = '***************';
$fb_app_secret = '********************************';
$facebook = new Facebook(array('appId'=>$fb_app_id, 'secret'=>$fb_app_secret, 'cookie'=>true));