Skip to content

Instantly share code, notes, and snippets.

William Malo williammalo

Block or report user

Report or block williammalo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@williammalo
williammalo / README.md
Last active Oct 3, 2015 — forked from 140bytes/LICENSE.txt
number splitter
View README.md

Splits numbers with commas to make them more readable. Thanks to @maettig for being awesome

@williammalo
williammalo / README.md
Last active Oct 3, 2015 — forked from 140bytes/LICENSE.txt
Make font size work with percentage
View README.md
@williammalo
williammalo / README.md
Last active Oct 5, 2015 — forked from 140bytes/LICENSE.txt
parse indentation of string
View README.md

This function returns an array of the indentation level of each line of a string.

I made this as part of a yaml parser I'm trying to do =D

you use it like this:

getIndent("\t\t\ttext\n\tmore text\nnot indented")

and it returns this:

@williammalo
williammalo / README.md
Last active Oct 5, 2015 — forked from 140bytes/LICENSE.txt
nodelists to arrays
View README.md

This code transparently makes nodelists act like arrays!

With it, you can do this:

document.getElementsByTagName('a').forEach(function(a){

a.style.color = '#F00'

})​

@williammalo
williammalo / README.md
Last active Oct 5, 2015 — forked from 140bytes/LICENSE.txt
jQuery .html() clone
View README.md

jQuery .html() clone

A (Hopefully) perfect clone of the jQuery .html() method

If it has an argument, it will set the innerhtml of the element to the value of the argument.

If it has no argument, it returns the innerHTML of the element.

It is also chainable! yay!

@williammalo
williammalo / README.md
Last active Oct 5, 2015 — forked from 140bytes/LICENSE.txt
element methods on nodelists
View README.md

This function allows element methods to be used on nodelists, kinda like what jQuery does.

@williammalo
williammalo / README.md
Last active Oct 5, 2015 — forked from 140bytes/LICENSE.txt
element coercion
View README.md

Why?

Because why the hell not?

Allows you to use nodelist methods on strings!

It's kinda useless on it's own, but with https://gist.github.com/2847249 it's pretty fun =D

@williammalo
williammalo / README.md
Last active Oct 5, 2015 — forked from 140bytes/LICENSE.txt
blockifyIndents
View README.md

Turns indentation into {curly brackets} Great for a yml to json converter or something. Credit to @maettig for writing all* the code.

Turn this:

if(3==3)
    alert("obviously!")
    alert("lol!")

Into:

@williammalo
williammalo / Description.md
Created Jun 19, 2012
Javascript Rss Reader
View Description.md

#Javascript Rss Reader#

Takes a rss feed and prints html (defined by a template) for every post.

@williammalo
williammalo / README.md
Last active Oct 6, 2015 — forked from 140bytes/LICENSE.txt
set element properties on nodelists
View README.md

a neat function that allows this:

document.getElementsByTagName('i').innerHTML="pie";

and it will change the innerHTML of all tags AUTOMATICALLY!!!!

incredible!

demo: http://jsfiddle.net/Vw54L/

You can’t perform that action at this time.