Skip to content

Instantly share code, notes, and snippets.

View voidfiles's full-sized avatar

Alex Kessinger voidfiles

View GitHub Profile
@voidfiles
voidfiles / table_test.md
Created July 18, 2012 00:38
Table Test

| | Grouping ||

First Header Second Header Third Header
Content Long Cell
Content Cell Cell

|New section | More | Data | |And more | And more | [Prototype table]

@voidfiles
voidfiles / yui_grid.scss
Created August 15, 2012 18:57
YUI3 Grids as a SASS mixin
@mixin yui_grid($namespace:'') {
/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.3.0
build: 3167
*/
.#{$namespace}yui3-g {
letter-spacing: -0.31em; /* webkit: collapse white-space between units */
@voidfiles
voidfiles / app_net_grids.md
Created August 15, 2012 19:01
How App.net uses YUI3 grids

How you can create a responsive grid system using YUI3 grids and SASS

This is a quick rundown of how and why we use YUI3 grids at App.net

As far as I can tell there are three types of CSS grids: a static-width pre-defined grid, a flexible-width pre-defined grid, and a generative grid. In the first two grids (pre-defined width), you basically decide how many columns you have across the screen, and then create blocks in any multiple of those. This pattern often looks like "span-4", "span-6", "pull-10", "push-5", etc. You find this style in popular frameworks like Bootstrap and Blueprint.

The third way, the generative/recursive grid system, doesn't seem to be as popular as the others. I am not entirely sure why, because the generative grid can pack more punch in less lines. In this vein is there is OOCSS and YUI3 CSS Grids.

@voidfiles
voidfiles / markdown.lua
Created November 2, 2012 01:09
webscript.io markdown module
local some_markdown = '[yo](http://google.com)'
local markdown = require('voidfiles/webscript-lua-modules/markdown.lua')
return markdown(some_markdown)
@voidfiles
voidfiles / adn_webscript.lua
Created November 4, 2012 23:08
Example integrating App.net and Webscript.io
function table.copy(t)
local t2 = {}
for k,v in pairs(t) do
t2[k] = v
end
return t2
end
function return_html(html)
return html, {["Content-Type"]="text/html"}
@voidfiles
voidfiles / expandurl.py
Last active December 12, 2015 09:29
I wanted to share clean URL's directly from my phone. This is most specifically geared towards feedburner URL's, but could be just short URL's as well. This script unwraps any URL's surrounded with ** in the text on your clipboard. Unwraps them, and clears out unwanted query params. Then opens the text in felix for posting.
"""
Pythonist script to expand any URL surrounded by **'s
"""
import clipboard
import requests
import webbrowser
import urlparse
from urllib import quote, urlencode
@voidfiles
voidfiles / parsepage.py
Last active December 13, 2015 16:48
Grab a whole webpage in Mobile Safari and send it to Pythonista.
# Parse a whole pages HTML, and sends it to pythonista for furthter editing.
# the bookmarklet
# javascript:var selected=encodeURIComponent(document.body.innerHTML);location.href='pythonista://parsepage?action=run&argv=['+encodeURIComponent(document.title)+']('+encodeURIComponent(location.href)+')'+selected;
import sys
print sys.argv
# From here I figure out could use bs4 to create a tag whitelist, then send it through html2md
# Could also look at using diffbot API to parse out the main content.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, re
import itertools
from functools import wraps
from pyquery import PyQuery as pq
class scrape:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Full script used in blog post at http://h6o6.com/2013/03/using-python-and-the-nltk-to-find-haikus-in-the-public-twitter-stream
4-clause license (original "BSD License")
Copyright (c) 2013, h6o6
All rights reserved.
@voidfiles
voidfiles / main.js
Created June 21, 2013 21:20
AOL Reader Beautified Javascript
/**
* Isotope v1.5.25
* An exquisite jQuery plugin for magical layouts
* http://isotope.metafizzy.co
*
* Commercial use requires one-time purchase of a commercial license
* http://isotope.metafizzy.co/docs/license.html
*
* Non-commercial use is licensed under the MIT License
*