Skip to content

Instantly share code, notes, and snippets.

View expalmer's full-sized avatar

Palmer Oliveira expalmer

View GitHub Profile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "hellobits"
config.vm.box_url = "http://hellobits.com/vagrant/hellobits.box"
config.vm.synced_folder ".", "/Projects", id: "vagrant-root"
# config.vm.network :private_network, ip: "192.168.50.2"
forward_port = ->(guest, host = guest) do
function soma (a, b) {
return a + b
}
module.exports = soma
@expalmer
expalmer / gist:6693109
Created September 25, 2013 00:05
Vagrant Configuration 1.3.3
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "devPhp"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"

Teste para projetos responsivos

##Problema Testar/verificar a disposição dos elementos de uma determinada página em determinadas resoluções de tela.

Solução

Executar captura de telas de acordo com os viewports definidos em um script, com a ajuda do PhantomJS.

Necessário ter o node e o npm instalados

@expalmer
expalmer / gist:cfbaf085256d5902ce2d
Last active August 29, 2015 14:05
Simple Require AMD
(function( context ) {
'use strict';
var modules = {};
var app = {
getDependencies: function( deps ) {
@expalmer
expalmer / gist:beca5945f19792228900
Last active August 29, 2015 14:05
Metalsmith Gist Embed Plugin
/**
* Module dependencies.
*/
var request = require('request');
var Q = require('q');
/**
* GistEmbed prototype.
*/
@expalmer
expalmer / gist:5f1693761a94c215cb23
Created August 16, 2014 19:26
Vazio é true ou false ? by @wbruno
# PHP
$ php -r "var_dump( (boolean)'') .PHP_EOL;"
bool(false)
# NodeJs
$ node
> !!""
false
# ShellScript
@expalmer
expalmer / gist:4bc6203dc2a3f7134e78
Last active August 29, 2015 14:05
Metalsmith Gist Test Example
var Animal = function ( name ) {
this.name = name;
}
Animal.prototype.getName = function () {
return this.name;
}
var tiger = new Animal('Tiger');
tiger.getName();
@expalmer
expalmer / gist:bb2266b59e2accb0499e
Created September 12, 2014 19:51
Error saving authentication: Error: read ECONNRESET
var OrtcNodeclient = require('ibtrealtimesjnode').IbtRealTimeSJNode;
var connectionUrl = 'http://ortc-developers.realtime.co/server/2.1/';
var appKey = 'myAppKey';
var authToken = 'myToken';
var channel = 'MyChannel';
var privateKey = 'myPrivateKey';
var isCluster = true;
@expalmer
expalmer / Estrutura de arquivos do Blog.
Last active August 29, 2015 14:06
blog - Metalsmith, um extremamente simples gerador de páginas estáticas feito em Javascript
[blog]
--- index.js
--- package.json
--- [src]
------- index.md
------- [posts]
------------- post-1.md
------------- post-2.md
--- [templates]
------- index.hbt