This file contains 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
/** | |
* @author Jane Ullah | |
* @purpose Problem 9 - Project Euler | |
* @date 12/29/2011 | |
* @site http://janetalkscode.com | |
*/ | |
public class Problem9 { | |
public static void main(String[] args) { | |
boolean matchFound = false; |
This file contains 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 void paintComponent(Graphics page){ | |
//Drawing vertical lines | |
super.paintComponent(page); | |
for (int i = 1; i <= WIDTH/JUMP; i++){ | |
//X is reduced by 1 to accommodate snake body size of 11x11. Recall outer shell of snake body is 12x12 | |
page.drawLine(JUMP*i-1, JUMP*3, JUMP*i-1, WIDTH); | |
//Drawing horizontal lines | |
//Y is reduced by 1 to accommodate snake body size of 11x11. | |
if (i >= 3){ | |
page.drawLine(0,JUMP*i-1,WIDTH,JUMP*i-1); |
This file contains 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
<script> | |
// Charles Lawrence - Feb 16, 2012. Free to use and modify. Please attribute back to @geuis if you find this useful | |
// Twitter Bootstrap Typeahead doesn't support remote data querying. This is an expected feature in the future. In the meantime, others have submitted patches to the core bootstrap component that allow it. | |
// The following will allow remote autocompletes *without* modifying any officially released core code. | |
// If others find ways to improve this, please share. | |
<!-- Typeahead by Charles Lawrence https://gist.github.com/1848558--> | |
<script type="text/javascript"> | |
var autocomplete = $('#stops').typeahead() | |
.on('keyup', function(ev){ |
This file contains 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
# Set expires header and Remove ETags | |
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)(\.gz)?$"> | |
Header set Expires "Thu, 15 Apr 2012 20:00:00 GMT" | |
Header unset ETag | |
FileETag None | |
</FilesMatch> | |
# Set cache-control header | |
<FilesMatch "\.(ico|jpg|png|gif)(\.gz)?$"> | |
Header set Cache-Control "public" |
This file contains 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
<!-- Typeahead by Charles Lawrence https://gist.github.com/1848558--> | |
<script type="text/javascript"> | |
var autocomplete = $('.typeahead').typeahead().on('keyup', function(ev){ | |
ev.stopPropagation(); | |
ev.preventDefault(); | |
//filter out up/down, tab, enter, and escape keys | |
if( $.inArray(ev.keyCode,[40,38,9,13,27]) === -1 ){ | |
var self = $(this); | |
//set typeahead source to empty | |
self.data('typeahead').source = []; |
This file contains 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
document.addEventListener('DOMContentLoaded', function () { | |
document.getElementById('save').addEventListener('click', save_options); | |
}); |
This file contains 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
<?php | |
require("Services/Twilio.php"); | |
require("database.php"); | |
// require POST request | |
if ($_SERVER['REQUEST_METHOD'] != "POST") die; | |
// generate "random" 6-digit verification code | |
$code = rand(100000, 999999); |
This file contains 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
function random_text( $type = 'alnum', $length = 8 ) | |
{ | |
switch ( $type ) { | |
case 'alnum': | |
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
break; | |
case 'alpha': | |
$pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
break; | |
case 'hexdec': |
This file contains 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/env php | |
<?php | |
// The email address notifications should be sent to | |
$____email_address = 'contact@twitapps.com'; | |
// This array maps incoming emails to scripts | |
$____processor_map = array( | |
// For the ta_follows user there's a separate script for each notification type | |
'ta_follows' => array( | |
'is_following' => dirname(__FILE__).'/ta_follows/new_follower.php', |
This file contains 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/env php | |
<?php | |
// The email address notifications should be sent to | |
$____email_address = 'contact@twitapps.com'; | |
// This array maps incoming emails to scripts | |
$____processor_map = array( | |
// For the ta_follows user there's a separate script for each notification type | |
'ta_follows' => array( | |
'is_following' => dirname(__FILE__).'/ta_follows/new_follower.php', |