Skip to content

Instantly share code, notes, and snippets.

View candidosales's full-sized avatar
🏠
Focusing

Candido Sales Gomes candidosales

🏠
Focusing
View GitHub Profile
@candidosales
candidosales / example-with-search-and-filters-button.js
Created May 23, 2014 00:55
isotope with search and filters button
// debounce so filtering doesn't happen every millisecond
function debounce( fn, threshold ) {
var timeout;
return function debounced() {
if ( timeout ) {
clearTimeout( timeout );
}
function delayed() {
fn();
timeout = null;
@candidosales
candidosales / gist:f276780a24b77e340bb3
Created September 20, 2014 21:11
Observações sobre Spree na implementação de front-end

Dificuldades

  • Já podia iniciar por padrão com PostgreSQL
  • Pra quê o uso do sufixo "decorator" em tudo que é para acrescentar algo? Não basta o .class_eval?
  • Organização dos assets na extension, o problema de ter as pastas sobrepostas. As pastas criadas por um extension, por padrão já devia sobrepor;
  • O caminho para usar meus JS são muito mal organizados, gostaria que fossem todos dentro da própria extension;
  • O caminho das imagens, também, gostaria que fossem pegas todas dentro da própria extension;
  • Devise.secret_key: Devia ser apresentado na documentação como resolver isso;
  • Instalação da internacionalização (ainda não consegui resolver no Windows, no Ubuntu rodou bacana);
  • Após instalação do spree_i18n é necessário refazer o seed:
  • Não é necessário carregar na extension o jquery e jquery_ujs pois o spree core já carrega;
var app = require('app'), // Module to control application life.
BrowserWindow = require('browser-window'); // Module to create native browser window.
path = require('path'),
ipc = require('ipc'),
hashes = require('jshashes'),
mime = require('mime'),
fs = require('fs'),
exec = require('child_process').exec;
userName = process.env.USERNAME,
<!DOCTYPE html>
<html>
<head>
<title>Palitagem</title>
</head>
<body>
<webview id="foo" src="http://localhost:81/registro-chamadas/autenticacao?u=043250663&d=VIKSTARSP" autosize="on" style="position:fixed;top:0;left:0;right:0;bottom:0" nodeintegration></webview>
<script>
var userName = process.env.USERNAME,
@candidosales
candidosales / Gruntfile.js
Created December 7, 2015 17:52
Gruntfile para projetos Java - VRaptor
module.exports = function(grunt) {
// 1. Time how long tasks take
require('time-grunt')(grunt);
// 2. load all grunt tasks matching the `grunt-*` pattern
require('load-grunt-tasks')(grunt);
// 3. All configuration goes here
grunt.initConfig({
@candidosales
candidosales / bower.json
Last active December 7, 2015 18:08
Bower para projetos Java - VRaptor
{
"name": "relatorios-qualidade",
"version": "1.0.0",
"authors": [
"candidosales <candidosg@gmail.com>",
"rafaellins <rafael.lins777@gmail.com>"
],
"license": "MIT",
"ignore": [
"**/.*",
@candidosales
candidosales / package.json
Created December 7, 2015 17:53
Package para projetos Java - Vraptor
{
"name": "relatorios-qualidade",
"version": "1.0.0",
"main": "main.js",
"dependencies": {
"jshashes": "^1.0.5",
"path": "^0.11.14",
"grunt": "^0.4.5",
"grunt-contrib-concat": "^0.5.1",
"grunt-contrib-connect": "^0.10.1",
@candidosales
candidosales / update_products.rake
Last active August 4, 2016 18:04
[Rake task] Atualizar adicionando uma descrição nos produtos do Spree - Incluir o arquivo na pasta lib/tasks do seu projeto
namespace :update_products do
desc "update_products"
task :description => :environment do
skus = ["ABR112803","ABR112903","ABR112703","ABR101703","ABR101903","ABR102303","ABR109203","ABR113403","ABR112806","ABR100803","ABR10103","ABR112906","ABR113003","ABR113103","ABR100903","ABR101303","ABR101403","ABR101503","ABR102103","ABR109003","ABR112503","ABR113203","ABR89603","ABR84703","ABR102506","ABR112706","ABR101706","ABR101906","ABR102306","ABR109206","ABR113406","ABR112812","ABR100806","ABR112912","ABR113006","ABR113106","ABR100906","ABR101006","ABR101306","ABR101406","ABR101506","ABR102106","ABR10906","ABR112506","ABR113206","ABR89606","ABR84706","ABR89303","ABR102512","ABR10003","ABR112712","ABR101912","ABR102312","ABR105503","ABR109212","ABR113412","ABR100812","ABR113012","ABR113112","ABR101012","ABR101312","ABR101512","ABR102112","ABR109012","ABR112512","ABR113212","ABR101712","ABR88303","ABR100912","ABR89612","ABR101412","ABR84712","ABR89306","ABR100006","ABR105506","ABR88306","ABR89312","ABR1000
@candidosales
candidosales / MainActivity.java
Created August 10, 2016 19:26
Check Google Play Services
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@candidosales
candidosales / nginx.conf
Created April 30, 2017 18:42
NGINX Docker + Website static + Performance + Security
user nginx;
# PERFORMANCE
# https://gist.github.com/denji/8359866
# you must set worker processes based on your CPU cores, nginx does not benefit from setting more than that
worker_processes auto; #some last versions calculate it automatically
# number of file descriptors used for nginx
# the limit for the maximum FDs on the server is usually set by the OS.
# if you don't set FD's then OS settings will be used which is by default 2000
worker_rlimit_nofile 100000;