Skip to content

Instantly share code, notes, and snippets.

View rhamses's full-sized avatar

Rhamses rhamses

View GitHub Profile
@boogah
boogah / .htaccess
Created February 16, 2012 04:59
Expire headers .htaccess code.
<IfModule mod_expires.c>
ExpiresActive on
# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault "access plus 1 month"
# Data
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
@faffyman
faffyman / prettyjson.css
Last active July 29, 2021 21:24
Pretty print and syntax highlight JSON See it in action at http://jsfiddle.net/faffyman/KRb8W/
pre {
outline: 1px solid #ccc;
padding: 5px; margin:
5px;
}
.string {
color: #008000;
}
@marioluan
marioluan / remover-acentos.js
Created October 10, 2013 18:27
Funcao marota para remover acentos de strings. Foi utilizado expressao regular em cima de caracteres representados na base hexadecimal.
/**
* Remove acentos de caracteres
* @param {String} stringComAcento [string que contem os acentos]
* @return {String} [string sem acentos]
*/
function removerAcentos( newStringComAcento ) {
var string = newStringComAcento;
var mapaAcentosHex = {
a : /[\xE0-\xE6]/g,
e : /[\xE8-\xEB]/g,
@quagliato
quagliato / select_estados.html
Last active June 6, 2024 23:50
<select> com todos os estados brasileiros
<select id="estado" name="estado">
<option value="AC">Acre</option>
<option value="AL">Alagoas</option>
<option value="AP">Amapá</option>
<option value="AM">Amazonas</option>
<option value="BA">Bahia</option>
<option value="CE">Ceará</option>
<option value="DF">Distrito Federal</option>
<option value="ES">Espírito Santo</option>
<option value="GO">Goiás</option>
@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active July 3, 2024 02:22
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@viebig
viebig / gist:246bdc5970eedc95c02d
Created May 8, 2015 20:55
DDD Geolocalização Latitude/Longitude
var dddGeo = [];
dddGeo[11] = {
latitude: -23.547778,
longitude: -46.635833
}; // | São Paulo | Região Metropolitana de São Paulo.
dddGeo[12] = {
latitude: -23.203416,
longitude: -45.890627
}; // | São Paulo | São José dos Campos e Região.
var gulp = require('gulp');
var runSequence = require('run-sequence');
var minifyCss = require('gulp-minify-css');
var buildDir = './build/';
var build = new Date().getTime();
var minifyCssSettings = { advanced: true, aggressiveMerging: true };
// Main build
@jkubecki
jkubecki / ExportKindle.js
Last active June 1, 2024 22:51
Amazon Kindle Export
// The following data should be run in the console while viewing the page https://read.amazon.com/
// It will export a CSV file called "download" which can (and should) be renamed with a .csv extension
var db = openDatabase('K4W', '3', 'thedatabase', 1024 * 1024);
getAmazonCsv = function() {
// Set header for CSV export line - change this if you change the fields used
var csvData = "ASIN,Title,Authors,PurchaseDate\n";
db.transaction(function(tx) {
@michelmany
michelmany / app.js
Last active April 22, 2023 00:42
Vue.js 2 Vee-validate (pt-br) CPF Validation
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import VeeValidator, { Validator } from 'vee-validate'
import CpfValidator from './components/validators/cpf.validator'
import Dictionary from './components/validators/dictionary'
import Produto from './components/produtos.vue'
Validator.extend('cpf', CpfValidator)
@allenday
allenday / make_TsvHttpData.pl
Last active September 3, 2018 10:07
Create URL list for Google Cloud Storage Transfer Service, see: https://cloud.google.com/storage/transfer/create-url-list
#!/usr/bin/perl
use strict;
my $http_base = shift;
my $path_base = shift;
my $prev_file = shift;
if ( ! $http_base || ! $path_base ) {
print STDERR <<"HERE";
USAGE: