Skip to content

Instantly share code, notes, and snippets.

View JKirchartz's full-sized avatar
🤖

Joel Kirchartz JKirchartz

🤖
View GitHub Profile
@JKirchartz
JKirchartz / convert.sh
Created November 2, 2015 18:41
Download Sherlock Novels to make corpora for NaNoGenMo15
#! /bin/sh
#
# convert.sh
#
# Copyleft (ↄ) 2015 jkirchartz <[email protected]>
#
# Distributed under terms of the NPL (Necessary Public License) license.
#
for file in ./sources/*.txt; do
@JKirchartz
JKirchartz / Playing with some ideas for tools.jkirchartz.com UI.markdown
Created November 3, 2015 20:35
Playing with some ideas for tools.jkirchartz.com UI

Playing with some ideas for tools.jkirchartz.com UI

I haven't worked on this site in a while & recently wrote a bunch of mini-tools I could cram in there, so I need a new UI to enable that.

A Pen by Joel Kirchartz on CodePen.

License.

@JKirchartz
JKirchartz / LibraryOfBabel.html
Created November 5, 2015 21:55
Quick "Library of Babel" book generator for NaNoGenMo, major hat-tip to Borges.
<!DOCTYPE html>
<style>article {border:1px solid lightgrey;}</style>
<div id='book'></div>
<script>
var chars = "abcdefghijklmnopqrstuvwxyz ., ,.";
var book = 410;
var page = 3200;
String.prototype.shuffle = function () {
var a = this.split(""),
n = a.length;
#!/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)
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
@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
@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 / 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 / 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 / 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'];
}