Skip to content

Instantly share code, notes, and snippets.

View sirovenmitts's full-sized avatar
:shipit:

Kenneth Pullen sirovenmitts

:shipit:
View GitHub Profile
@sirovenmitts
sirovenmitts / syllable-guessing.st
Last active December 18, 2015 08:09
Guess the number of syllables in a word. Not as good as looking up stuff from the CMU pronunciation dictionary...
"This is a naive implementation of syllable guessing. This is for Amber smalltalk. It probably works elsewhere with minor changes."
| word |
word := 'tumult' asLowercase.
word := word replaceRegexp: '(?:[^laeiouy]es|ed|[^laeiouy]e)$' with: ''.
word := word replaceRegexp: '^y' with: ''.
console log: ( word matchesOf: ( RegularExpression fromString: '[aeiouy]{1,2}' flag: 'g' ) ) size.
"Use the CMU Pronunciation Dictionary to determine the number and stress of syllables in a word. Obviously this only works with words that are in the dictionary."
#!/bin/bash
#
# Version 0.2, for Ubuntu 13.04 (Raring)
#
# Based on Chrubuntu 34v87 script
BASE_IMAGE_FILE="http://mirrors.med.harvard.edu/ubuntu-cdimage/lubuntu/releases/13.04/release/lubuntu-13.04-preinstalled-desktop-armhf+ac100.tar.gz"
# fw_type will always be developer for Mario.
# Alex and ZGB need the developer BIOS installed though.
@sirovenmitts
sirovenmitts / fpack
Created May 17, 2013 08:24
Got a sweet Samsung Chromebook? Why not spruce it up a little with a fanny pack! This script will download an Arch rootfs and install it at /usr/local/fpack so you can chroot into it and have access to a package manager, compiler, and much more. It'll also create a script at /usr/local/bin/enter that will take care of mounting everything for you…
#!/bin/bash
# This script starts background processes, so I need to murder them.
function abort { kill $! &>/dev/null ; red ":(\n" ; exit 1 ; }
# For debugging purposes
function log { echo -e "Stardate `date`: $1" >> "$LOG" ; }
# Shove heredocs into variables.
function define { IFS='' read -r -d '' ${1} ; }
@sirovenmitts
sirovenmitts / string_joiner.c
Last active December 12, 2015 12:49 — forked from anonymous/gist:4773146
Brian, here is my quick take on your problem. The code works as expected, but makes some assumptions, namely: Input will be less than 255 bytes long; and, newlines (\n) and carriage returns (\r) will only be at the end of input. God help you if they are somewhere in the middle.
// ask for two strings and join the first half of the first string
// with the second half of the second string.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#define SIZE 255