Skip to content

Instantly share code, notes, and snippets.

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

Dan Jesus danjesus

🏠
Working from home
View GitHub Profile
@danjesus
danjesus / LDB3.php
Created October 26, 2011 20:00 — forked from DfKimera/LDB3.php
<?php
/**
* Diesel Framework
* Copyright © LQDI Technologies - 2011
* http://www.lqdi.net
*
* Serviço de abstração do banco de dados
* Light Database Abstraction Layer
*
@danjesus
danjesus / js_hint_conf.js
Created November 1, 2012 16:23 — forked from voidfiles/js_hint_conf.js
JSHint conf options
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 10000, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
"node" : false,
@danjesus
danjesus / Fetch.sublime-settings
Created November 13, 2012 13:37
Sublime Text 2 Fetch Settings
{
"files":
{
"Dynamic-Carousel": "https://raw.github.com/Wilto/Dynamic-Carousel/master/plugin.js",
"FitText": "https://raw.github.com/davatron5000/FitText.js/master/jquery.fittext.js",
"FitVids": "https://raw.github.com/davatron5000/FitVids.js/master/jquery.fitvids.js",
"Lettering.js": "https://raw.github.com/davatron5000/Lettering.js/master/jquery.lettering.js",
"Normalize.css": "https://raw.github.com/necolas/normalize.css/master/normalize.css",
"Sass-Css3-Mixins": "https://raw.github.com/matthieua/Sass-Css3-Mixins/master/css3-mixins.scss",
"_rem.scss": "https://raw.github.com/ry5n/rem/master/stylesheets/_rem.scss",
Links, livros, artigos e etc comentados durante o Hangout 'JavaScript e Design Patterns': http://youtu.be/FkED71eM7s8
class User < ActiveRecord::Base
# ...
def self.sync_users
users_to_sync = where synced: false
SyncUsers.new(users_to_sync).tap &:sync
end
# ...
end
class UsersSyncer
@danjesus
danjesus / ex.php
Last active December 20, 2015 06:29 — forked from anonymous/gist:6085380
Filtrando dados de um array multidimensional
<?php
// array com os dados
$data = array(
array(
"id" => 12,
"func" => "João dos Santos",
"urgencia" => "Sim",
"retirada" => "2013-07-24",
"prazo" => 10,
<?php
// Add the correct Content-Type for the cache manifest
header('Content-Type: text/cache-manifest');
// Write the first line
echo "CACHE MANIFEST\n";
// Initialize the $hashes string
$hashes = "";
master_process on;
worker_processes 4;
worker_cpu_affinity 0001 0010 0100 1000;
worker_priority 0;
worker_rlimit_nofile 8192;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
/**
* Created by Mota on 10/08/2014.
*/
module.exports = function(grunt) {
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
// a list of useful queries for profiler analysis. Starting with the most basic.
// 2.4 compatible
//
// output explained:
//
{
"ts" : ISODate("2012-09-14T16:34:00.010Z"), // date it occurred
"op" : "query", // the operation type
"ns" : "game.players", // the db and collection