Skip to content

Instantly share code, notes, and snippets.

View lpsouza's full-sized avatar

Luiz Souza lpsouza

View GitHub Profile
@jamiew
jamiew / tumblr-photo-ripper.rb
Created July 13, 2011 17:46
Download all the images from a Tumblr blog
# Usage:
# [sudo] gem install mechanize
# ruby tumblr-photo-ripper.rb
require 'rubygems'
require 'mechanize'
# Your Tumblr subdomain, e.g. "jamiew" for "jamiew.tumblr.com"
site = "doctorwho"
@matoakley
matoakley / gist:1092571
Created July 19, 2011 14:38
MySQL to convert a string into a slug
LOWER(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TRIM('My String'), ':', ''), ')', ''), '(', ''), ',', ''), '\\', ''), '\/', ''), '\"', ''), '?', ''), '\'', ''), '&', ''), '!', ''), '.', ''), ' ', '-'), '--', '-'), '--', '-')) AS `post_name`
@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@hSATAC
hSATAC / mitmproxy.py
Created August 9, 2012 03:36
How to modify http request host and port using mitmproxy script
def request(context, flow):
if "miiicasa.com" in flow.request.host:
if flow.request.scheme == "https":
flow.request.host = "192.168.254.9"
flow.request.port = "50113"
if flow.request.scheme == "http":
flow.request.host = "192.168.254.9"
flow.request.port = "50110"
@rikels
rikels / README.md
Last active February 6, 2022 23:25
chromium os plugins

this scripts installs: Flash, PDF, for some Chromium OS builds. (confirmed on Vanilla build 3389 Built on 12th December 2012!) Carputers confirmed that it also works on ArnoldTheBat's Cx86OS-20130423010101 build!

Sadly enough the Hangouts stopped working! i don't know about Netflix, since i can't test it. and since ~4-08-2013 MP3/Mp4 stopped working?

if you want to use this script on ArnoldTheBat's Chromium OS build, keep in mind that he uses the password: "password" instead of "facepunch". (without the quotes ;))

@chrislkeller
chrislkeller / import_json_appsscript.js
Last active July 16, 2024 13:26
Adds what amounts to an =ImportJSON() function to a Google spreadsheet... To use go to Tools --> Script Editor and add the script and save.
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@Starefossen
Starefossen / tmux-cheats.md
Last active July 20, 2024 15:33
My personal tmux cheat sheet for working with sessions, windows, and panes. `NB` I have remapped the command prefix to `ctrl` + `a`.

Sessions

New Session

  • tmux new [-s name] [cmd] (:new) - new session

Switch Session

  • tmux ls (:ls) - list sessions
  • tmux switch [-t name] (:switch) - switches to an existing session
@smoser
smoser / ubuntu-cloud-virtualbox.sh
Last active July 5, 2024 09:33
example of using Ubuntu cloud images with virtualbox
## Install necessary packages
$ sudo apt-get install virtualbox-ose qemu-utils genisoimage cloud-utils
## get kvm unloaded so virtualbox can load
$ sudo modprobe -r kvm_amd kvm_intel
$ sudo service virtualbox stop
$ sudo service virtualbox start
## URL to most recent cloud image of 12.04
$ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release"
@sirishn
sirishn / tumblr.rb
Last active December 11, 2018 08:33
tumblr downloader, download all pictures and videos from a tumblog usage ruby tumblr.rb blog #ofposts(optional) example ruby tumblr.rb internet.tumblr.com ruby tumblr.rb internet.tumblr.com 50
#!/usr/bin/ruby
# Tumblr downloader (video and images only)
require 'rubygems'
require 'open-uri'
require 'json'
def get_media(blog, max_posts)
@key = "fuiKNFp9vQFvjLNvx4sUwti4Yb5yGutBN4Xh10LXZhhRKjWlV4"
# ;)
@simonista
simonista / .vimrc
Last active July 21, 2024 14:41
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on