Skip to content

Instantly share code, notes, and snippets.

View blizzarddreams's full-sized avatar
❄️
arctic fox

Blizzard blizzarddreams

❄️
arctic fox
  • Kentucky
  • 02:50 (UTC -04:00)
View GitHub Profile
var turn = 1, withAi, firstMove, hard;
// Set all blocks taken to false
blockTaken0 = false,
blockTaken1 = false,
blockTaken2 = false,
blockTaken3 = false,
blockTaken4 = false,
blockTaken5 = false,
@danhyun
danhyun / wtf.java
Created September 22, 2014 21:52
public String getPrettyAddress() {
String prettyAddress = null;
if (this.getAddresses() != null && !this.getAddresses().isEmpty()) {
Address mainAddress = null;
if (this.getAddresses().get(BusinessAddressType.PRIMARY.getType()) != null) {
mainAddress = this.getAddresses().get(BusinessAddressType.PRIMARY.getType()).getAddress();
} else if (this.getAddresses().get(BusinessAddressType.SHIPPING.getType().toLowerCase()) != null) {
mainAddress = this.getAddresses().get(BusinessAddressType.SHIPPING.getType().toLowerCase()).getAddress();
}
anonymous
anonymous / DataCollator.java
Created October 2, 2014 00:50
package datacollator;
import java.util.List;
import java.util.ArrayList;
import java.awt.geom.Point2D;
import java.io.File;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.awt.Image;
@alxjrvs
alxjrvs / SassMeister-input-HTML.haml
Created October 8, 2014 02:31
Generated by SassMeister.com.
.button
Click
.button--error
Error
.button--success
Success
.button--pending
Pending
require 'oj'
class HummingbirdListImport
include Enumerable
# Most ListImport systems shouldn't need a `list` parameter, since they separate manga and anime
# exports. We do, since our backups contain your whole library.
def initialize(str, list)
@list = Oj.load(str)[list.to_s]
# The class of the database we're matching against
@daihuaye
daihuaye / generateUid.js
Created November 4, 2014 04:56
unique random id
var generateUid = function() {
var d = new Date().getTime();
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = (d + Math.random()*16)%16 | 0;
d = Math.floor(d/16);
return (c === 'x' ? r : (r&0x7|0x8)).toString(16);
});
return uuid;
};
@sonald
sonald / parser.y
Created November 4, 2014 05:09
cool parser
/*
* cool.y
* Parser definition for the COOL language.
*
*/
%{
#include <iostream>
#include "cool-tree.h"
#include "stringtab.h"
#include "utilities.h"
@quininer
quininer / beep_bleep.pl
Last active August 29, 2015 14:08
irssi config
#!/usr/bin/irssi
#
# irssi beep replace script (tested with irssi v0.8.8.CVS (20030126-1726))
# (C) 2002-2004 Ge0rG@IRCnet (Georg Lukas <georg@op-co.de>)
# inspired and tested by Macrotron@IRCnet (macrotron@president.eu.org)
# added beep_flood to irssi settings: beep_cmd will be run not more often
# then every $beep_flood milliseconds
# fixed memory leak with timeout_add (made irssi waste 80mb and more after a day of IRC)
@exit99
exit99 / Auto-Dave
Last active March 1, 2016 19:35
Automating Dave's Job
import time
import urllib2
from datetime import datetime
def do_dave():
while 10 < datetime.now().hour < 15:
time.sleep(5)
urllib2.urlopen('http://www.reddit.com/')
@panpawn
panpawn / botreminders.js
Last active August 29, 2015 14:10
A reminder command for PS bots.
/*
* Bot Reminders Command
* Credits: panpawn
*
* Steps to add in this command:
* 1. Create a file named "reminders.txt" in the main directory.
* 2. Copy in the command below into commands.js.
* 3. Edit the command for "remind_view_users" and "remind_edit_users" accordingly.
* 4. Reload chat commands.
* 5. PM the bot: .r add, hi