Skip to content

Instantly share code, notes, and snippets.

View christophermoura's full-sized avatar

Christopher Moura christophermoura

View GitHub Profile
function RemoveAccents(strAccents) {
var strAccents = strAccents.split('');
var strAccentsOut = new Array();
var strAccentsLen = strAccents.length;
var accents = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž';
var accentsOut = "AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz";
for (var y = 0; y < strAccentsLen; y++) {
if (accents.indexOf(strAccents[y]) != -1) {
strAccentsOut[y] = accentsOut.substr(accents.indexOf(strAccents[y]), 1);
} else
🗼🗼🗼🗼🗼🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁
🗼🗼🗼🗼🗼🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁
🗼🗼🗼🗼🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🌁🌁🌁🌁🌁🌁🌁🌁
🗼🗼🗼🗼🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🌁🌁🌁🌁🌁🌁🌁🌁
🗼🗼🗼🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🌁🌁🌁🌁🌁🌁🌁
🗼🗼🗼🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🌁🌁🌁🌁🌁🌁🌁
🗼🗼🗼🌁🌁🌁🌁🌁🌁🌁🌁🌁🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🍚📱🔘👟🔘🏂🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🌁🌁🌁🌁🌁🌁
🗼🗼🗼🌁🌁🌁🌁🌁🌁🌁🌁🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🃏🚽🌷🎣🎣💣🚏🔊🔲👟📃⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🌁🌁🌁🌁🌁
🗼🗼🗼🌁🌁🌁🌁🌁🌁🌁🌁🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁📤🛀🔪🔝🔨🔌🔛🔝🚏🎣🚏🚏🔊📃⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🌁🌁🌁🌁🌁
🗼🗼🌁🌁🌁🌁🌁🌁🌁🌁🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🌁🐚🚥🎓🎓🔝🔛🔚🔛🔚🎓🎣🚏🚏🔪🔲🏭⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🌁🌁🌁🌁
@christophermoura
christophermoura / tumblr-photo-ripper.rb
Created February 3, 2016 12:39 — forked from jamiew/tumblr-photo-ripper.rb
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"
@christophermoura
christophermoura / .gitconfig
Created November 19, 2015 17:48 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = [email protected]
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
@christophermoura
christophermoura / audio_tag.rb
Created September 30, 2015 13:11 — forked from tabletick/audio_tag.rb
Audio/MP3 Plugin for Octopress
# Title: MP3 tag for Jekyll
# Authors: Devin Weaver, Daniel Roos (youtube changes)
# Description: Allows mp3 tag to include mp3 files embedded into the post.
# It uses the player 'audio.js' from http://kolber.github.com/audiojs/
#
# Install the plugin according to the manuel of the author by adding the necessary lines to the head-template
# and adding the files into the right directories.
#
# Please read my [blog post about it][2].
#
@christophermoura
christophermoura / All Posts
Last active September 17, 2015 00:36 — forked from philsturgeon/All Posts
Octopress iTunes Feed
---
layout: post
title: "Episode 3: ExpressionEngine StackExchange"
date: 2012-12-20 10:47
comments: true
filename: some-file-name-without-extension
length: 52409154
summary: ExpressionEngine Pro Anna Brown and Testing Hero Chris Hartjes join Ben Edmunds and Phil Sturgeon to discuss the recent rumblings in the ExpressionEngine community and the new EE StackExchange site. We talk about Inversion of Control (IoC), what it is, why its useful and how it's done.
---
@christophermoura
christophermoura / handle-missing-image.js
Last active August 29, 2015 14:27 — forked from murtaugh/handle-missing-image.js
If an image fails, what do we do? In my case, maybe I've already defined a backup (usually in the case of inline SVGs), so we should look for that first. If that fails, then we'll hide the image (or do whatever the context requires).
$('img').on('error', function(){
//console.log('img load failure: ' + $(this).attr('src'));
var fallback = $(this).attr('data-fallback');
if (typeof fallback !== 'undefined' && fallback !== false) {
$(this).attr('src', fallback);
@christophermoura
christophermoura / keyboard-controls.js
Last active August 29, 2015 14:27 — forked from murtaugh/keyboard-controls.js
Keyboard Controls
document.onkeydown = checkKey;
function checkKey(e) {
e = e || window.event;
if ((e.keyCode == '39') || (e.keyCode == '40')) { // right / down arrow
console.log('right / down');
@christophermoura
christophermoura / 0_reuse_code.js
Last active August 29, 2015 14:18
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
/*
POMODORO 0.2
by @erikaheidi
January 2015
LED STATES:
starts blue - idle. When the button is clicked, it starts a pomodoro working phase. LED will be a red "breathing" style.
After the time is done, it will change to GREEN (static) - indicating that the pomodoro was completed and now you should go to a PAUSE
When clicking the button, the PAUSE phase will start (GREEN "BREATHING"). It will turn to RED (static) when the pause is done, indicating that
a new WORKING phase should follow. When the button is clicked, starts over with the WORKING phase (RED breathing LED) :)