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 / filter_los.js
Last active January 9, 2020 22:01
Filter LOs in Mintos.... (current list is all that offer Interest income on delayed payments)
// ==UserScript==
// @name Filter Mintos LO's
// @namespace http://tampermonkey.net/
// @version 0.7
// @description Filter Mintos LO's that offer "Interest income on delayed payments"
// @author Rodrigo GraΓ§a
// @match https://www.mintos.com/en/invest-en/primary-market/*
// @grant none
// @updateURL https://gist.githubusercontent.com/rodrigograca31/5f632bbaac2bab849435707eea532911/raw/filter_los.js
// @downloadURL https://gist.githubusercontent.com/rodrigograca31/5f632bbaac2bab849435707eea532911/raw/filter_los.js
@rodrigograca31
rodrigograca31 / gulp.js
Created April 25, 2017 22:30
Gulp Service Worker
// https://medium.com/google-developer-experts/add-offline-support-to-any-web-app-c20edc4bea0e
gulp.task('sw', function(callback) {
var path = require('path');
var swPrecache = require('sw-precache');
var fs = require('fs');
var rootDir = folder;
//var options = require('./sw-precache-config.json');
var options = JSON.parse(fs.readFileSync('./sw-precache-config.json', 'utf-8'));
options.ignoreUrlParametersMatching = [/./];
@rodrigograca31
rodrigograca31 / gulpfile.js
Last active April 14, 2017 00:34
Example gulpfile
// including plugins
var gulp = require('gulp');
var browserSync = require('browser-sync');
var minifyHtml = require('gulp-minify-html');
var minifyCss = require('gulp-minify-css');
var uglify = require('gulp-uglify');
var runSequence = require('run-sequence');
var clean = require('gulp-clean');
var injectPartials = require('gulp-inject-partials');
var imagemin = require('gulp-imagemin');
@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
@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 / 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 / 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 / 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 / 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 / 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;