Skip to content

Instantly share code, notes, and snippets.

View svolpe43's full-sized avatar

Shawn Volpe svolpe43

View GitHub Profile
@svolpe43
svolpe43 / gist:9925837
Created April 2, 2014 00:31
Leaderboard controller
$userinfos = query("SELECT * FROM users ORDER BY cash DESC");
if ($userinfos === false)
{
apologize("Couldn't load your data.");
}
$positions = [];
$rank = 1;
//Cycle through each user
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
//Javascript
$("document").ready(function(){
$("#mod-form").submit(function(e){
$.ajaxSetup({
headers: { 'X-CSRF-Token' : $('meta[name=_token]').attr('content') }
});
e.preventDefault();
var name = $("input#name").val();
var token = $("input[name=_token]").val();
var dataString = 'name='+name+'&token='+token;
/*
* My javascript
*
**/
$("#moduleform").submit(function(e){
$.ajaxSetup({ headers: { 'X-CSRF-Token' : $('meta[name=_token]').attr('content') } });
e.preventDefault();
var name = $("input#modname").val();
var token = $("input[name=_token]").val();
Step = .001
A = 500;
B = 1000;
Range = A - B
arrayLength = Range / Step
Michael Bublé,Jason Mraz,光田康典,The National,Sarah McLachlan,Claude Debussy,Lady Gaga,周杰倫,植松伸夫,Indochine,Rise Against,City and Colour,Radiohead,Red Hot Chili Peppers,Alexisonfire,Bebo & Cigala,The Mars Volta,Chick Corea & Hiromi,Theory of a Deadman,Cantaloupe Island,Adam's Apple,A Brighter Day,Afrodisia,Mambo De La Pinta,Greg Osby,James Newton,Testify,Art Blakey,Caravan,Tsuyoshi Sekito,Mira,Temptation,A Night In Tunisia,Serj Tankian,Winter,Duke Pearson,Cantaloop (Flip Fantasia),Cæcilie Norby,El Cumbanchero,You Don't Know What Love Is,Death Letter,Art Taylor,Closer to Home,Indio Gitano,Solomon Ilori and his Afro-Drum Ensemble,Black Byrd,Far West,Hi-Heel Sneakers,Congalegra,There Is The Bomb
The Beatles,Chase Coy,Stephen Jerzak,nevershoutnever!,Taylor Swift,The Maine,All Time Low,Boys Like Girls,McFly,Owl City,Glee Cast,Brokencyde,Ke$ha,Relient K,Cobra Starship,Jason Mraz,Across The Universe Soundtrack,Romance On A Rocketship,Hellogoodbye,Avril Lavigne,Show Me The Skyline,Hey Monday,Sterling Knight,Kate Nash,Plai
#!/bin/bash -l
echo "Checking City of Boston db for R60CTR.."
resp=`curl -isS http://www.cityofboston.gov/towing/search/?plate=R60CTR`
# make sure the request came back ok
if echo $resp | grep "HTTP/1.1 200 OK"; then
# check for the criteria
if echo $resp | grep -pG "Plate not found."; then
result=" "
message="R60CTR not found."
@svolpe43
svolpe43 / gist:baf2b6ac00a0978e0a0cd3364358a3ee
Created October 28, 2016 18:35
Extract and index html pages into a Solr Cloud stack.
var request = require('request');
var fs = require('fs');
var solr_host = 'http://<>-us-east-1.sr-dev.acquia.com';
var collection;
var host;
if(process.argv[2] && process.argv[3]){
collection = process.argv[2];
void CardProcessor::FindBlankLengthAndIndex(Card *card) {
unsigned int i = 0;
unsigned int j = 0;
bool blankFound = false;
int blankLength = 0;
string buffer = card->GetStr();
for (i = 0; i < buffer.length(); i++) {
if(buffer[i] == '_'){
void CardProcessor::FindBlankLengthAndIndex(Card *card) {
unsigned int i = 0;
int j = 0;
int blankIndex = 0;
int blankLength = 0;
string buffer = card->GetStr();
bool foundBlank = false;
for (i = 0; i < (buffer.length()); i++) {