Skip to content

Instantly share code, notes, and snippets.

View rodrigograca31's full-sized avatar
👨‍💻
Professional 🐛 solver

Rodrigo Graça rodrigograca31

👨‍💻
Professional 🐛 solver
View GitHub Profile
@rodrigograca31
rodrigograca31 / gradle.properties
Created February 18, 2016 11:01
My Global gradle configuration: (~/.gradle/gradle.properties)
org.gradle.parallel=true
org.gradle.daemon=true
org.gradle.jvmargs=-Xms512m -Xmx2048m
org.gradle.configureondemand=true
@rodrigograca31
rodrigograca31 / special_chars.php
Created March 10, 2016 19:10
CodeIgniter special characters function.
function filename($title){
$a = array('À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ð', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', 'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', 'ß', 'à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', 'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'ÿ', 'Ā', 'ā', 'Ă', 'ă', 'Ą', 'ą', 'Ć', 'ć', 'Ĉ', 'ĉ', 'Ċ', 'ċ', 'Č', 'č', 'Ď', 'ď', 'Đ', 'đ', 'Ē', 'ē', 'Ĕ', 'ĕ', 'Ė', 'ė', 'Ę', 'ę', 'Ě', 'ě', 'Ĝ', 'ĝ', 'Ğ', 'ğ', 'Ġ', 'ġ', 'Ģ', 'ģ', 'Ĥ', 'ĥ', 'Ħ', 'ħ', 'Ĩ', 'ĩ', 'Ī', 'ī', 'Ĭ', 'ĭ', 'Į', 'į', 'İ', 'ı', 'IJ', 'ij', 'Ĵ', 'ĵ', 'Ķ', 'ķ', 'Ĺ', 'ĺ', 'Ļ', 'ļ', 'Ľ', 'ľ', 'Ŀ', 'ŀ', 'Ł', 'ł', 'Ń', 'ń', 'Ņ', 'ņ', 'Ň', 'ň', 'ʼn', 'Ō', 'ō', 'Ŏ', 'ŏ', 'Ő', 'ő', 'Œ', 'œ', 'Ŕ', 'ŕ', 'Ŗ', 'ŗ', 'Ř', 'ř', 'Ś', 'ś', 'Ŝ', 'ŝ', 'Ş', 'ş', 'Š', 'š', 'Ţ', 'ţ', 'Ť', 'ť', 'Ŧ', 'ŧ', 'Ũ', 'ũ', 'Ū', 'ū', 'Ŭ', 'ŭ', 'Ů', 'ů', 'Ű', 'ű', 'Ų', 'ų', 'Ŵ', 'ŵ', 'Ŷ', 'ŷ', 'Ÿ', 'Ź', 'ź', 'Ż', 'ż', 'Ž', 'ž', 'ſ', 'ƒ', 'Ơ', 'ơ', 'Ư', 'ư', 'Ǎ', 'ǎ', 'Ǐ', 'ǐ', 'Ǒ', 'ǒ', 'Ǔ', 'ǔ',
@rodrigograca31
rodrigograca31 / .jslintrc
Last active April 11, 2016 16:19
my jslint definitions
{
"predef": [
"angular",
"$",
"window",
"console",
"cordova",
"navigator",
"document"
]
@rodrigograca31
rodrigograca31 / shuffle-array.js
Created June 22, 2016 16:58
Shuffle Array in Javascript
/**
* Randomize array element order in-place.
* Using Durstenfeld shuffle algorithm.
*/
function shuffleArray(array) {
for (var i = array.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = array[i];
array[i] = array[j];
array[j] = temp;
@rodrigograca31
rodrigograca31 / files.php
Last active June 29, 2016 16:54
PHP File enumeration, ordered and no path
<?php
header('Content-Type: application/json');
$files = glob('./imgs/*.jpg');
foreach($files as &$file) {
$file = str_replace("./imgs/", "", $file);
}
@rodrigograca31
rodrigograca31 / apm_list.txt
Last active November 14, 2018 17:41
apm list - Atom Editor
Built-in Atom Packages (92)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
@rodrigograca31
rodrigograca31 / 010_size_and_open-build.js
Last active December 6, 2016 00:12
Cordova hook that displays the .apk size and opens the folder containing it.
#!/usr/bin/env node
// make sure android platform is part of build
// if (ctx.opts.platforms.indexOf('android') < 0) {
// return;
// }
var fs = require('fs');
var path = require('path');
var exec = require('child_process').exec;
@rodrigograca31
rodrigograca31 / 0_reuse_code.js
Created July 29, 2016 14:38
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@rodrigograca31
rodrigograca31 / etiquetar.js
Created February 18, 2017 13:52
Etiquetar ataques
// ==UserScript==
// @name Etiquetar ataques automaticamente.
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://pt50.tribalwars.com.pt/game.php?village=*&screen=overview_villages&mode=incomings&type=unignored&subtype=attacks*
// @match https://pt50.tribalwars.com.pt/game.php?village=*&screen=overview_villages&mode=incomings&action=process&type=unignored&subtype=attacks*
// @grant none
// ==/UserScript==
@rodrigograca31
rodrigograca31 / .htaccess
Last active May 26, 2017 10:50
example .htaccess
# Force HTTPS
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
#HSTS
<IfModule mod_headers.c>
Header set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
</IfModule>
# Block file listing