Skip to content

Instantly share code, notes, and snippets.

@andrew8088
andrew8088 / yui_exercise_1.html
Created January 21, 2011 18:35
For some reason, the handler on "#groupA li" works for lis in groupB
<div id="exercise" class="yui3-g">
<div class="yui3-u-1-2">
<h3>Group A</h3>
<ul id="groupA">
<li>Steven Tyler</li>
<li>Joe Perry</li>
<li>Brad Whitford</li>
<li>Tom Hamilton</li>
</ul>
</div>
@andrew8088
andrew8088 / twitter-scrolling.js
Created February 16, 2011 14:07
This code is an alternate version of the code found in my tutorial on Nettuts+: http://net.tutsplus.com/tutorials/javascript-ajax/implement-twitter-scrolling-without-jquery-2
$(document).bind("scroll", function (e) {
scrolling = true;
});
setInterval(function () {
if (scrolling) {
//console.profile("scroll");
scrolling = false;
var temp_top = win.scrollTop(),
down = scroll_top - temp_top < 0 ? true : false,
<article class="post">
<header>
<h1>Google Plus: Success and Failure</h1>
</header>
<footer>
<h2>TL. DR.</h2>
<p>I won't use Google Plus (right now), because it doesn't fill a need
in my social web sharing.</p>
<h2>Meta</h2>
@andrew8088
andrew8088 / MyObject.js
Created July 29, 2011 20:35
This little JavaScript object is a quick example for a Nettuts+ tutorial.
var MyObject = function (state) {
this._state = state;
}
MyObject.prototype.setState = function (state) {
this._state = state;
};
MyObject.prototype.addState = function (state) {
if (typeof this._state === "string") {
this._state = [this._state, state];
} else {
@andrew8088
andrew8088 / Move-to-Dropbox-public-folder.applescript
Created August 2, 2011 00:42
This AppleScript (for use in Keyboard Maestro) will copy the file selected in the Finder to your public dropbox folder and copy the public link to the file to your clipboard. Don't forget to change The XXXXXX to your public "ID".
-- Add file to Dropbox Script
-- Andrew Burgess, modified a bit from http://www.bencardy.co.uk/blog/dropbox-applescript/
-- You'll have to change the first part of your Dropbox URL, in the filePath variable
-- Also, make sure the myPath variable points in the right direction
on splitText(delimiter, someText)
set prevTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to delimiter
set output to text items of someText
@andrew8088
andrew8088 / test.sh
Created January 11, 2012 02:53
This little script is an example script combining JSDev with running the script in the terminal via node.
#! /bin/sh
d=$(date)
jsdev <test.js >test.dev.js code equal:areEqual -comment "Development Version" -comment "Built: $d"
node test.dev.js
@andrew8088
andrew8088 / detectives.sql
Created July 6, 2012 01:41
Intrepid Detectives database for the SQL Essentials course for Tuts+ Premium
CREATE DATABASE intrepid_detectives;
USE intrepid_detectives;
CREATE TABLE detectives(
id INTEGER NOT NULL AUTO_INCREMENT,
first_name VARCHAR(50),
last_name VARCHAR(50) NOT NULL,
phone_number VARCHAR(10) NOT NULL,
certification_date DATE NOT NULL,
CONSTRAINT detectives_pk PRIMARY KEY (id)
@andrew8088
andrew8088 / gist:4360639
Created December 22, 2012 19:37
Having some fun with the Befunge programming language. This is a simple looping coin toss program.
> v
v,,,,,,,,,,,,,,,,,,,,"Welcome to Coin Toss"<
>52*, v
v"Type H or T to choose heads or tails:"<
>,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,v
v `*8*52~ <
v ? v
v_v ^ v_v
> v <
v <
@andrew8088
andrew8088 / prof.sql
Created July 5, 2012 18:51
This is the SQL code to set up a database for a problem I had on a database management exam. Here's the problem: write an SQL query that will return a table of the names and salaries of the professors who teach 20 or more students.
CREATE DATABASE profs;
USE profs;
CREATE TABLE professors (
name varchar(30) NOT NULL,
specialization varchar(20),
salary double(8,2),
CONSTRAINT prof_pk PRIMARY KEY (name));
CREATE TABLE students (
@andrew8088
andrew8088 / fizzbuzz.befunge
Created December 24, 2012 16:31
FizzBuzz in Befunge.
1v >"zzuBzziF" ,,,,,,,,$v
>>::35*%!| >"zzuB" ,,,,$v
>:5%!| >"zziF",,,,$v
|%+1*:*25:+1< >:3%!|
@ .
^ ,*25< <