Skip to content

Instantly share code, notes, and snippets.

View emanuelpessoaa's full-sized avatar

Emanuel Pessoa emanuelpessoaa

  • João Pessoa, PB
View GitHub Profile
// Fonts mixin
font-url(file)
return '../fonts/' + file
webfont(family, file, hack-chrome-windows = false, weight = 'normal')
@font-face
font-family family
src url(font-url(file + '.eot'))
src url(font-url(file + '.eot?#iefix')) format('embedded-opentype'),
url(font-url(file + '.woff')) format('woff'),
(function () {
'use strict';
angular.module('myApp.users', [
'ngRoute',
'myApp.users.Controllers',
'myApp.users.Service'
])
.config(routes);
@emanuelpessoaa
emanuelpessoaa / video.html
Created April 28, 2016 13:05
Html snippet for video mp4 using object tag
<p>
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="600" height="415">
<param name="pluginspage" value="http://www.apple.com/quicktime/download/" />
<param name="src" value="VIDEO-FILE-NAME-HERE.MP4" />
<param name="controller" value="true" />
<param name="loop" value="false" />
<param name="autoplay" value="false" />
<param name="autostart" value="false" />
<param name="scale" value="aspect" />
@emanuelpessoaa
emanuelpessoaa / callback.js
Last active April 15, 2016 23:33
NodeJS Modularization with Callback
//module example.js
var exports = {};
exports.search = function(firstName, lastName, callback) {
this.thedude = {};
this.thedude.name = firstName + ' ' + lastName;
callback(this.thedude.name);
};
module.exports = exports;
//end of example.js
@emanuelpessoaa
emanuelpessoaa / osx-mongodb-rlimits-fix.md
Created February 28, 2016 17:03 — forked from tamitutor/osx-mongodb-rlimits-fix.md
Fix Mongodb "soft rlimits" Warning On Mac OS X (Yosemite)

If you are seeing Mongo soft rlimits warnings in your logs, or a WARNING: soft rlimits too low. Number of files is 256, should be at least 1000 when you login to mongo shell via mongo from the commandline, or any mysterious/unexplained mongo connection errors... follow this how-to exactly and it will resolve the issue for you.

(Source of this how to found at basho/basho_docs#1402)

First file: sudo vi /Library/LaunchDaemons/limit.maxfiles.plist

...containing:

@emanuelpessoaa
emanuelpessoaa / source.slit
Created October 15, 2015 04:05
source.slit trusty ubuntu
### See http://help.ubuntu.com/community/UpgradeNotes.
### Default Repos.
deb http://br.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://br.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
### Security Updates.
deb http://security.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
### Major bug fix updates.
@emanuelpessoaa
emanuelpessoaa / sourcelist
Last active October 11, 2015 05:56
sourcelist
# deb cdrom:[Ubuntu 10.04 LTS _Lucid Lynx_ - Release i386 (20100429)]/ lucid main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://br.archive.ubuntu.com/ubuntu/ lucid main restricted
deb-src http://br.archive.ubuntu.com/ubuntu/ lucid main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://br.archive.ubuntu.com/ubuntu/ lucid-updates main restricted
a25f44d154cc342634c7
@emanuelpessoaa
emanuelpessoaa / createElement
Last active August 29, 2015 14:20
Javascript anonymous function expression creates the specified HTML element with attributes and contents.
/**
* createElement - creates the specified HTML element with attributes and contents.
* @param {HTML ELEMENT}
* @param {ATTRIBUTE}
* @param {CONTENT}
* @return {ELEMENT}
*
* Usage: createElement("h1","[style:color:#fff;background:#000;][class:myClass][id:myId]", "My Title");
*/
@emanuelpessoaa
emanuelpessoaa / App\Exceptions\Handler.php
Created February 25, 2015 13:07
Laravel 5 HttpException Error 404
<?php namespace App\Exceptions;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Database\Eloquent\ModelNotFoundException;
class Handler extends ExceptionHandler {
/**
* A list of the exception types that should not be reported.