This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var turn = 1, withAi, firstMove, hard; | |
| // Set all blocks taken to false | |
| blockTaken0 = false, | |
| blockTaken1 = false, | |
| blockTaken2 = false, | |
| blockTaken3 = false, | |
| blockTaken4 = false, | |
| blockTaken5 = false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .button | |
| Click | |
| .button--error | |
| Error | |
| .button--success | |
| Success | |
| .button--pending | |
| Pending |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * cool.y | |
| * Parser definition for the COOL language. | |
| * | |
| */ | |
| %{ | |
| #include <iostream> | |
| #include "cool-tree.h" | |
| #include "stringtab.h" | |
| #include "utilities.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * 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 |