Skip to content

Instantly share code, notes, and snippets.

View fguisso's full-sized avatar
🌭
Hot dogs

Fernando Guisso fguisso

🌭
Hot dogs
View GitHub Profile
@fguisso
fguisso / angular.js
Last active August 29, 2015 14:02
app.js
var onepageApp = angular.module('onepageApp', ['ngRoute']);
onepageApp.config(function($routeProvider) {
$routeProvider
.when('/', {
templateUrl : 'pages/home.html',
controller : 'mainController'
})
.when('/about', {
templateUrl : 'pages/about.html',
@fguisso
fguisso / gist:9d18e06dc01cd52b0227
Last active August 29, 2015 14:06
FTP Credentials no Wordpres localhost

Quando você tenta instalar um novo tema direto pelo wordpress, ele pede suas credencias de FTP, mas como estamos trabalhando localmente, precisamos de algumas alterações para conseguir fazer isso. Primeiro acresente essa linha ao arquivo wp-config.php: define('FS_METHOD','direct'); Depois, se ainda não deu permições para suas pastas, va até ao diretorio onde esta instalado o wordpress e execute esses comandos: sudo chown -R _www wordpress_dir sudo chmod -R g+w wordpress_dir

, mongoose = require('mongoose')
, dbURI = 'mongodb://localhost/boilerplate'
, db = mongoose.connection
;
mongoose.connect(dbURI);
// CONNECTION EVENTS
// Quando a conexão der certo
db.on('connected', function () {
console.log('Conexão mongoose aberta com ' + dbURI);
});
@fguisso
fguisso / be-mean.md
Last active August 29, 2015 14:15
Depois que faço o cadastro pela view da esse erro
Conectado.
Conexão aberta.
Produto criado:  { products: 
   { __v: 0,
     price: 100,
     _id: 54d91be6ef55d769c45bc4f0,
     created_at: Mon Feb 09 2015 18:43:18 GMT-0200 (BRST),
     description: 'Gente boa',
     name: 'Gravino' } }

POST /api/products 200 37.995 ms - 137

@fguisso
fguisso / fucker.sublime-keymap
Last active July 26, 2016 19:02
Sublime settings
[
{ "keys": ["option+c"], "command": "insert", "args": {"characters": "ç"} }
]
@fguisso
fguisso / socket.js
Last active September 6, 2015 23:57 — forked from Anderson-Juhasc/socket.js
var ws = new WebSocket('wss://api.blinktrade.com/trade/');
ws.on('open', function() {
console.log('open connect');
ws.send("channel or msg");
});
ws.on('message', function(message) {
console.log(message);
sudo chown -R $username ~/.npm
@fguisso
fguisso / sleepSystem.md
Created September 30, 2015 16:05
Set Sleep Due to Mac system inactivity in Command Line

##Set sleep time sudo systemsetup -setcomputersleep 60 where 60 is te time in minutes

##Turn of sleep sudo systemsetup -setcomputersleep Never

##Check current sleep status sudo systemsetup -getcomputersleep

@fguisso
fguisso / osx-10.10-setup.md
Last active September 28, 2016 01:59 — forked from kevinelliott/osx-10.10-setup.md
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@fguisso
fguisso / Caesar-cipher.js
Created November 14, 2015 17:24
Cryptools
/*
* Automatic Caesar cipher breaker
*
* Copyright (c) 2014 Project Nayuki
* All rights reserved. Contact Nayuki for licensing.
* http://www.nayuki.io/page/automatic-caesar-cipher-breaker-javascript
*/
"use strict";