Skip to content

Instantly share code, notes, and snippets.

Glen Chiacchieri Glench

Block or report user

Report or block Glench

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
View canvas_draw.html
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
html, body {
margin: 0;
padding: 0;
}
canvas {
View gist:b1a99b5e75d50e162411
var body = document.querySelector('body');
var styleNode = document.createElement('style');
var cssTextNode = document.createTextNode('#content a:visited { color: rgb(41, 229, 41) !important; }');
styleNode.appendChild(cssTextNode);
body.appendChild(styleNode);
View img.js
var baseUrl = 'http://127.0.0.1:5000';
var wikipedify = function(best_guess) {
return 'https://en.wikipedia.org/wiki/Special:Search/'+best_guess;
};
var makeLink = function(href, text, title) {
return '<a href="'+href+'" target="_blank" title="'+title+'">'+text+'</a>';
};
$('img').each(function(i, img) {
var $img = $(img)
$.get(baseUrl+'?image_url='+window.location.href+img.getAttribute('src')).done(function(data) {
View music.txt
This file has been truncated, but you can view the full file.
Faster Pussy cat<SEP>Silent Night
Karkkiautomaatti<SEP>Tanssi vaan
Hudson Mohawke<SEP>No One Could Ever
Yerba Brava<SEP>Si Vos Querés
Der Mystic<SEP>Tangle Of Aspens
David Montgomery<SEP>Symphony No. 1 G minor "Sinfonie Serieuse"/Allegro con energia
Sasha / Turbulence<SEP>We Have Got Love
Kris Kross<SEP>2 Da Beat Ch'yall
Joseph Locke<SEP>Goodbye
View wp_factboxes.py
import sys
import itertools
from pyquery import PyQuery as pq
def download_and_parse(wikipedia_url):
page = pq(url=wikipedia_url.strip())
key_values = {}
for tr in page('.infobox tr'):
tr = pq(tr)
cells = tr('th,td')
@Glench
Glench / autocomplete.js
Last active Aug 29, 2015
allows you to change google's autocomplete to whatever you want >:) type into google to create an autocomplete list, then activate this bookmarklet
View autocomplete.js
javascript:(function()%7Bfunction%20callback()%7B(function(%24)%7Bvar%20jQuery%3D%24%3Bfunction%20omgwtfval(term)%20%7Breturn%20'%3Cli%20class%3D%22sbsb_c%20gsfs%22%20dir%3D%22ltr%22%20style%3D%22text-align%3A%20left%3B%22%3E%20%3Cdiv%20role%3D%22option%22%3E%20%3Cdiv%20class%3D%22sbqs_c%22%3E'%20%2B%20term%20%2B%20'%3C%2Fdiv%3E%20%3C%2Fdiv%3E%20%3C%2Fli%3E'%3B%7D%3Bfunction%20omgwtf(val)%20%7B%24('ul.sbsb_b%20li').remove()%3Bvar%20terms%20%3D%20val.split('%5Cn')%3Bterms.forEach(function(term)%20%7B%24('ul.sbsb_b').append(omgwtfval(term))%3B%7D)%3B%7D%3B%24('body').prepend(%24('textarea').attr('id'%2C%20'omgwtf').css(%7Bposition%3A%20'absolute'%2C%20right%3A%2020%2C%20top%3A%2020%2C%20width%3A%20300%2C%20height%3A%20400%2C%20zIndex%3A%201000000%2C%20display%3A%20'block'%7D))%3B%24('%23omgwtf').on('input%20propertychange'%2C%20function()%20%7Bomgwtf(this.value)%3B%24('.mw%2C%20%23footcnt%2C%20%23main').remove()%3B%7D)%7D)(jQuery.noConflict(true))%7Dvar%20s%3Ddocument.createElement(%22script%22)%3Bs.src%3D%22ht
@Glench
Glench / gist:ce45454d8677247c7a8a
Created Jun 9, 2015
John Holt in "How Children Learn"
View gist:ce45454d8677247c7a8a
One of the puzzles we had in my fifth-grade class was a geometrical puzzle called Hako. You
began with a number of thin, flat, rectangular plastic pieces arranged a certain way in a
shallow box. The aim was to slide them around, without turning them or lifting them out of
the box, so as to finish with the largest piece, a square, at the opposite end of the box from
which it started. Though I spent many hours on it, I was never able to do it. This exasperated
me. What exasperated me even more was that I seemed to be able to prove that the puzzle was
impossible--though I knew it was not. Like most people, I began by moving the pieces around
in a kind of blind, haphazard way. Before long, and unwisely, I grew impatient with this.
There were too many possible moves, this could go on forever. The thing to do was use the
brain and figure it out. So, moving the pieces very carefully, and analyzing each move, I
View display.html
<script src="underscore-min.js"></script>
<script src="jquery-1.11.0.min.js"></script>
<script type="text/javascript">
ws = new WebSocket("ws://puku.local:8001");
ws.onmessage = function(evt) {
console.log('hi')
$('#display').html('<img src="'+ evt.data +'"/>')
};
</script>
@Glench
Glench / gist:90c0bc0905c87a7cebae
Last active Sep 19, 2015
Sacred Economics, page 198
View gist:90c0bc0905c87a7cebae

I am writing at this moment in a large airport. Thousands of people work at jobs associated with this airport, and few of the jobs actually befit a human being.

I traveled to the airport in a hotel shuttle. On the way I told the driver, a Peruvian immigrant, about the talk I had given this weekend and about my vision of a more beautiful world, and at one point, by way of illustration, I said, “Here you are driving back and forth to the airport all day—surely you must have moments when you think, ‘I was not put here on earth to do this.’”

“Yeah, that’s for sure,” he said.

I can’t help but think the same as I watch the cashier at the airport kiosk, typing in purchase items and handing out change and saying, “Thank you sir, have a nice day,” and the man going from trash can to trash can, emptying them into his cart and changing the plastic bag, silent and sullen, wooden-faced. What kind of world have we created, that a human being spends all day doing such tasks? What have we become, that we ar

@Glench
Glench / ubuntu-setup.md
Created Apr 2, 2012 — forked from jmondo/ubuntu-setup.md
Setting up Rails server environment on Ubuntu 11.10
View ubuntu-setup.md

Setting up Rails server environment on Ubuntu 11.10

Including Rails, Passenger, RVM, Ruby 1.9.3, SSH keys, Postgres and a test app

Instructions

  • This is tested on a clean install of Ubuntu 11.10 server (with SSH root access), though it should work on whatever install you have now.
  • Replace LOGIN with your ubuntu username
  • Replace SERVER_ADDRESS with the IP address of your server
You can’t perform that action at this time.