Skip to content

Instantly share code, notes, and snippets.

View albertosouza's full-sized avatar
👨‍🔬
Creating things

Alberto Souza albertosouza

👨‍🔬
Creating things
View GitHub Profile
@tleen
tleen / gist:5109955
Created March 7, 2013 17:30
Format a Javascript Date to RFC-822 datetime using moment.js
var rfc822Date = moment(yourDate).format('ddd, DD MMM YYYY HH:mm:ss ZZ')
@hayes
hayes / compound-socket.js
Last active December 10, 2015 18:18
a quick way to get access to compound routing/controllers through socket.io
var sio = require('socket.io');
var fn = function () {};
var http = require('http');
module.exports = function (compound) {
var app = compound.app;
var server = http.createServer(app);
compound.server = server;
var io = compound.io = sio.listen(server);
@edwardhotchkiss
edwardhotchkiss / graphics_magick_center_image_on_canvas.js
Created October 31, 2012 03:32
Use GM Module (Graphics Magick) for Node.js to center an image on a white background canvas
var gm = require('gm');
var canvasWidth = 248;
var canvasHeight = 389;
gm(__dirname + '/original.jpg').size(function(error, size) {
if (error) {
console.error(error);
@letanure
letanure / estados-cidades.json
Last active April 30, 2024 23:07
JSON estados cidades do brasil, dividido por estados. segunda lista atualizada em 2020, dados do IBGE
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@crtr0
crtr0 / client.js
Created June 8, 2012 17:02
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@kevinSuttle
kevinSuttle / meta-tags.md
Last active March 31, 2024 14:26 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags
@jnrbsn
jnrbsn / GPL.md
Last active April 29, 2023 14:59
A Markdown-formatted GPL for your GitHub projects.

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.