Skip to content

Instantly share code, notes, and snippets.

View rustoceans's full-sized avatar

Rust Oceans rustoceans

  • Milano - IT
View GitHub Profile
@rustoceans
rustoceans / README-Template.md
Created October 5, 2017 05:44 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@rustoceans
rustoceans / flash-app.js
Created October 5, 2017 05:21 — forked from brianmacarthur/flash-app.js
Flash messaging in Express 4: express-flash vs. custom middleware in ejs, handlebars, or jade
var express = require('express');
var cookieParser = require('cookie-parser');
var session = require('express-session');
var flash = require('express-flash');
var handlebars = require('express-handlebars')
var app = express();
var sessionStore = new session.MemoryStore;
// View Engines
@rustoceans
rustoceans / gist:ca2cdc9d4500d604dfb3ec269fe2834d
Last active October 5, 2017 02:12 — forked from mrtns/gist:78d15e3263b2f6a231fe
Upgrade Chrome from Command Line on Ubuntu
# Install
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Update
@rustoceans
rustoceans / 0_reuse_code.js
Created April 25, 2017 06:33
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
@rustoceans
rustoceans / mimimi.py
Created November 8, 2016 23:26 — forked from fbidu/mimimi.py
def mimimi(frase):
"""
Função que mimimiza frases
>>> mimimi('Por que você não tá estudando pra sua prova de amanhã?')
'Pir qii vici nii ti istidindi pri sii privi di iminhi?'
"""
n = ('ã', 'a', 'e', 'o', 'u', 'á', 'é', 'ê', 'í', 'ó')
for letra in n:
frase = frase.replace(letra, 'i')
return frase
@rustoceans
rustoceans / torrents.py
Created February 15, 2016 03:45 — forked from rdenadai/torrents.py
A simple python script that downloads a deezer playlist and bam! download magnetic files from pirate bay or monova and put on transmission torrent client... keep in mind that you need transmission to run this, open it and configure the remote option in preferences!
# DEPENDENCIES
# LINUX INSTALLS!
# apt-get install transmission firefox python-dev python-pip
# PYTHON LIBS NEED IT!
# pip install requests beautifulsoup4 transmissionrpc pyopenssl ndg-httpsclient pyasn1 selenium
import requests as req
import transmissionrpc
@rustoceans
rustoceans / gist:77d5b638208d5682f87e
Created November 17, 2015 16:17 — forked from kwatch/gist:4204380
Custom Decorator for View Method in Pyramid 1.3
import sys
from pyramid.view import view_config
from venusian import ATTACH_ATTR # view_config() uses 'venusian' module internally
##
## utility
##
def view_method(fn, **kwargs):
# get frame of class definition
@rustoceans
rustoceans / fabfile.py
Last active August 29, 2015 14:17 — forked from agconti/fabfile.py
import os
import random
import string
from fabric.api import env, local, require, lcd
# for aws keys
# use an external file called secerts thats excluded from version control
# or use envoirmental varibles ( prefered ).
import secerts