Jan 03, 2006
Web Developer for Walt Disney
Winter Garden, FL
About me
Code | Comics | Conservative | #ENTP | Opinions are my own | SRE at @disney | Formerly @espn and @ucf
PHP, CSS, Javascript (jQuery, node.js, Angular), Java

Code Snippets

sean created a Page  -  Sep 14, 2014

Below is a very simple example of how to create a basic websocket using node.js. Websockets are great for maintaining a server/client relationship without as much of the overhead of HTTP web traffic. Today, websockets are used to build a magnitude of browser-based real-time applications (live chats, multiplayer games). Basically it's a persistent connection between the server and client in which both..

sean created a Page  -  Feb 24, 2014

Setting up a GET endpoint in Express is straight forward. However, creating a POST endpoint took a little research as the data posted to the endpoint isn't readily available without some intervention.

sean created a Page  -  May 22, 2013

This is a simple example using Push and Popstate. This practice is becoming more common throughout sites such as Twitter and Facebook for changing a URL within the address bar without reloading another page. Typically this allows users to bookmark or share URLs when sites are using some type of infinite scroll.

sean created a Page  -  Aug 02, 2012
1 286 

For anyone looking to setup a virtual environment, this post should save you a bit of headache. There are quite a few paths you can choose when looking to setup some type of virtual management system: Virtualbox, VMware, and KVM just to name a few. Personally, I feel as if KVM is the easiest to use and manage plus it’s free on top of being extremely easy to use via command line. Through out this..

sean created a Page  -  May 29, 2012
1 149 

APGAR is the one-way hashing algorithm all legacy Command and Conquer games use to send and store user passwords. This snippet is a simple port of the PHP version submitted some time ago.

sean created a Page  -  May 09, 2012

Over the years I've had many fights with Samba. Some won, some lost; but overall, Samba is a great piece of software for sharing data across networks. In this example, we'll be setting up a simple Samba share that can be accessed (without restriction) via Windows or any other environment.

sean created a Page  -  May 04, 2012
1 279 

The below snippet will create a MySQL user and grant them all permissions on the given database. The % wildcard identifier will allow this particular user to be accessible via any hostname. While the * wildcard will grant the user access to all tables within the supplied database. You can change either to match your specific needs.

sean created a Page  -  May 03, 2012
1 197 

Thought it would be a neat exercise to recreate the mIRC $gettok() function in javascript as I've seen it popup in several other languages. The only caveat I'm aware of is when passing multiple N parameters (eg: '2-6' or '2-'); it must be in string format. Otherwise javascript will interpret N and pass undesired results (eg: '-4'). If only passing one N parameter, integer use is recommended.

sean created a Page  -  May 27, 2011

string array_peek( array $a, string $k ) This function returns a string of the next key in sequential order of $a, delimited by $k. Useful when iterating through an array. and needing to "peek ahead" of a key.

  3 Threads   PHP  
sean created a Page  -  Dec 10, 2010

This is a simple MySQLi extender example. You instantiate this class just as you would MySQLi.

 Respond   PHP  
sean created a Page  -  Dec 07, 2010

This is a simple pagination snippet I wrote for a Drupal module I was working on. I've unDruaplized it and now it's completely independent.

  4 Threads   PHP  
sean created a Page  -  Jun 06, 2010

This is a Westwood Online server emulator for Command and Conquer: Tiberian Sun.

  1 Thread   mIRC  
sean created a Page  -  May 23, 2010

this is the one way routine Command and Conquer: Tiberian Sun uses to encrypt user passwords. pretty weak algorithm and extremely old game but, thought it would be fun to share. needed this to have the ability to match credentials for a server i'm developing. :)

 Respond   PHP  
sean created a Page  -  Mar 13, 2010

a simple template class to separate design from code (mvc). similar to the ever popular smarty framework, just not nearly as big lol

  5 Threads   PHP  
sean created a Page  -  Mar 04, 2010
2 667 

simple mysql class.usage: change predefined vars under 'mysql server configuration' to suit your environment.

  8 Threads   PHP  
sean created a Page  -  Sep 16, 2008

this will retrieve your halo 3 weapon kills and medals from social rankings. the image id and how many kills/medals gets spit out via array ( example of how to use image id within snippet ). made this for a facebook app that im creating and decided to share. this snippet is not mysql reliant, it stores everything within the specified cache file ('xbl_h3_cache.txt').

  8 Threads   PHP  
sean created a Page  -  Sep 08, 2008

simple encryption example. output is the sum of 2 and the ascii value of each character. for example, below is listed a string of characters and their ascii value.s = 115, e = 101, a = 97, n = 110

  9 Threads   PHP  
sean created a Page  -  Sep 17, 2006

Simply put the code in your sites functions.php and call it in page_head.php! check_referer() check_referer("./difname")

  1 Thread   PHP  
sean created a Page  -  Sep 17, 2006

Output: Array [0] => l.o.n.g.s.u.b.d.o.m.a.i.n [1] => ddomainn [2] => net

 Respond   PHP  
sean created a Page  -  Sep 15, 2006

[b]List: A blacklist that enables users to set individual attributes to blacklistees. Decently scripted dialog for easy control and encrypted output file so noone can "snoop" your blacklist! Right Click [b]List

sean created a Page  -  Sep 14, 2006

Just fixed up a old xml function I had laying around. This will return an associative array. I dug it up for a news bot Im coding, it reads google rss feeds.

  3 Threads   PHP  
sean created a Page  -  Sep 14, 2006

output: 36 years 8 months 3 weeks 2 days 24 minutes 32 seconds 36 years 8 months 3 weeks 2 days 36 years 8 months

  8 Threads   PHP  
sean created a Page  -  Jul 06, 2006

//echo -ae $_enc(test cows) standard encryption and decryption example

sean created a Page  -  Jul 03, 2006

text encrypter. insert into remotes

sean created a Page  -  May 24, 2006

remade the script posted previously, out of pure bordem; nicklist >> rightclick

sean created a Page  -  Mar 10, 2006

this is the halo2 stats grabber by DarthReven i just added a dialog looks like it could have used one :)

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.