Skip to content

Instantly share code, notes, and snippets.

View JKirchartz's full-sized avatar
🤖

Joel Kirchartz JKirchartz

🤖
View GitHub Profile
@JKirchartz
JKirchartz / windowResizeHeight.js
Last active December 13, 2016 15:53
If I have to write bad code to get the "right" design, so be it, but at least I can keep it D.R.Y. -- This snippet listens to window sizing commands, internally the sameHeight functions take a container class and a child's class, find the tallest child, then makes all that containers children the same height -- this is only for when CSS's `flexb…
$(window).resize(function(){
function sameHeight(container, child) {
$(container).each(function(){
var tallest = 0;
$(child, this).each(function(){
if($(this).height() > tallest) {
tallest = $(this).height();
}
});
$(child, this).height(tallest);
@JKirchartz
JKirchartz / brainyquotes.py
Last active January 23, 2018 05:48
Download all quotes from BrainyQuotes by search terms, print in fortune format (note: doesn't seem to work on OSX)
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyleft (ↄ) 2016 jkirchartz <[email protected]>
#
# Distributed under terms of the NPL (Necessary Public License) license.
"""
Download all quotes from BrainyQuotes by search terms, print in fortune format
@JKirchartz
JKirchartz / AjaxWordPress.md
Created October 17, 2016 20:24
WordPress AJAX Resources, stolen from CHRISMCCOY @ http://pastebin.com/gpp0wdry
@JKirchartz
JKirchartz / excerpt.snippets
Last active September 1, 2016 13:14
Wordpress Snippets
$excerpt = $post_object->post_excerpt;
if ( $excerpt == '' ) {
$content_arr = get_extended( $post_object->post_content );
$excerpt = $content_arr['main'];
}
@JKirchartz
JKirchartz / auto-orient.sh
Created July 22, 2016 19:00
A short script to fix folders worth of iPhone's EXIF-oriented images, so they're flipped the correct way, instead of upside-down like dumb iPhone photos.
#! /bin/bash
find . -iname "*.jpg" -type f -exec mogrify -auto-orient '{}' \;
@JKirchartz
JKirchartz / ChromaticScale.as
Created July 20, 2016 15:26
Play a chromatic scale with actionscript (circa 2008) demo: http://bit.ly/2a0pUjV
[SWF(width=200,height=50,backgroundColor=0x666666,frameRate=24)]
var sound:Sound = new Sound();
/* ################ Set the Starting Frequency */
var freq:Number=1046.5;
/* ################ Set the Sample Rate */
var rate:Number=44100;
var phase:Number=0;
var chan:SoundChannel = new SoundChannel();
var trans:SoundTransform = new SoundTransform(0,0);
chan.soundTransform = trans;
@JKirchartz
JKirchartz / PrimaryCSS.css
Created July 16, 2016 03:04
Primary CSS, 22 Page layouts that always work, Created by Curtiss Pope in the Summer of 2010, based off Wally Wood's 22 Panels that Always work.
.mainbody{ margin-left: auto;margin-right: auto; width:960px}
/* Layout 1 */
.Layout1_1{ width:33.3%; background-color:Red; height:400px; float:left;}
.Layout1_2{ width:33.3%; background-color:Blue; float:left; height:400px; }
.Layout1_3{ width:33.3%; background-color:Green; float:left; height:400px; }
.Layout1_header{ background-color:Yellow; width:100%; height:100px;}
/* Layout 2 */
@JKirchartz
JKirchartz / jpeg-optimize.sh
Last active October 5, 2016 18:14
quick script I made to ensure files were under a certain dimensional threshold and optimize them for the web, depends on imagemagick and mozjpeg (or jpegtran)
#!/bin/bash
base_dir='/site/'
input_dir="${base_dir}images"
output_dir="${base_dir}optimal-images"
# copy files to work on
echo "copying files to work on"
rsync -ahW "${input_dir}" $output_dir
We can't make this file beautiful and searchable because it's too large.
aries Good vibes in the air will help make today's Full Moon pleasant. You feel genuinely sympathetic and sensitive to the needs of partners and close friends. Gosh, golly, gee!
taurus Today, the only Full Moon in your sign all year takes place. Fortunately for you, other planetary aspects nicely smooth everything over. (Looking good!)
gemini This is an interesting day for love affairs, romance and sweet flirtations. Similarly, the arts and sports also are pleasantly blessed. Enjoy good times with children.
cancer Even though there is some tension with today's Full Moon, it's still a very pleasant day with family members. People are gentle and kind to each other.
leo Your communications with siblings and relatives are particularly warm and caring today because you appreciate where the other person is coming from and what he or she is going through. This is a good thing.
virgo You might be tempted to spend too much money on elegance and luxury today. Just keep this in mind. Don't be rash with your hard-earned
#!/usr/bin/env python
from pyquery import PyQuery as pq
import re
from unidecode import unidecode
import optparse
def get_lyrics(band):
band = re.sub(r'\s','_',band)
url = "http://www.allthelyrics.com/lyrics/" + unidecode(band)