Skip to content

Instantly share code, notes, and snippets.

View Contraculto's full-sized avatar
🔨

Rodrigo Lanas Contraculto

🔨
View GitHub Profile
<audio id="alarm" src="alarm.ogg" controls></audio>
<script>
const alarmElement = document.getElementById('alarm');
const alarmTimes = [
new Date('2015-11-13 07:00 -0500'),
new Date('2015-11-13 08:00 -0500'),
new Date('2015-11-13 08:30 -0500'),
];
function playAlarm() {
@shri
shri / pokemonImages.json
Created March 25, 2014 13:31
a json file containing images of pokemon
{"Bulbasaur":"http://img.pokemondb.net/artwork/bulbasaur.jpg","Ivysaur":"http://img.pokemondb.net/artwork/ivysaur.jpg","Venusaur":"http://img.pokemondb.net/artwork/venusaur.jpg","Charmander":"http://img.pokemondb.net/artwork/charmander.jpg","Charmeleon":"http://img.pokemondb.net/artwork/charmeleon.jpg","Charizard":"http://img.pokemondb.net/artwork/charizard.jpg","Squirtle":"http://img.pokemondb.net/artwork/squirtle.jpg","Wartortle":"http://img.pokemondb.net/artwork/wartortle.jpg","Blastoise":"http://img.pokemondb.net/artwork/blastoise.jpg","Caterpie":"http://img.pokemondb.net/artwork/caterpie.jpg","Metapod":"http://img.pokemondb.net/artwork/metapod.jpg","Butterfree":"http://img.pokemondb.net/artwork/butterfree.jpg","Weedle":"http://img.pokemondb.net/artwork/weedle.jpg","Kakuna":"http://img.pokemondb.net/artwork/kakuna.jpg","Beedrill":"http://img.pokemondb.net/artwork/beedrill.jpg","Pidgey":"http://img.pokemondb.net/artwork/pidgey.jpg","Pidgeotto":"http://img.pokemondb.net/artwork/pidgeotto.jpg","Pidgeot":"htt
@shri
shri / pokemon.json
Last active October 21, 2023 16:31
JSON of pokemon to go with my pokemonMoves.json file
{
"1":{
"name":"Bulbasaur",
"attack":49,
"defense":49,
"evolveLevel":16,
"evolveTo":"2",
"type":"grass",
"moves":[
"tackle",
var crypto = require("crypto")
var User = function(attributes) {
this._attributes = attributes || {}
}
User.KEY_LENGTH = 32
User.WORK_FACTOR = 20000
User.prototype.setPassword = function(password, callback) {
@jiko
jiko / rapgenius_scraper.py
Created November 4, 2013 17:06
Scrapes Rap Genius for song lyrics. Leaves some mess to clean up in the output.
import requests # for grabbing pages
from bs4 import BeautifulSoup # for parsing pages
import codecs
# grab page
root = "http://rapgenius.com"
path = "/artists/2-chainz"
page = requests.get(root+path)
# load downloaded page into BS
@bobspace
bobspace / css_colors.js
Last active June 24, 2024 13:46
All of the CSS Color names in a big javascript object.
// CSS Color Names
// Compiled by @bobspace.
//
// A javascript object containing all of the color names listed in the CSS Spec.
// This used to be a big array, but the hex values are useful too, so now it's an object.
// If you need the names as an array use Object.keys, but you already knew that!
//
// The full list can be found here: https://www.w3schools.com/cssref/css_colors.asp
// Use it as you please, 'cuz you can't, like, own a color, man.
@liamcurry
liamcurry / gist:2597326
Created May 4, 2012 19:56
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@derekpitt
derekpitt / check.coffee
Created February 11, 2012 23:11
big brother
# Big brotha is watching at http://big-brotha.appspot.com/static/index.html
# The map view is annoying though.. plus most of the cameras listed don't work anymore..
# This script just checks them all and then let's you know if any of them give a 200.
url = require 'url'
http = require 'http'
generate_callback = (data, f) -> -> f(data)