Skip to content

Instantly share code, notes, and snippets.

View anglinb's full-sized avatar

Brian Anglin anglinb

View GitHub Profile
@anglinb
anglinb / gist:7276492
Last active December 27, 2015 05:48
Using Scroll Event to change active links in navigation bar. Also, clicking nav links will scroll to the corresponding section.
<!DOCTYPE>
<head>
<title>Scorll Nav Example</title>
<style type="text/css">
.active{
color: green;
border: 1px solid black;
}
.wrapper{
width: 960px;
@anglinb
anglinb / database.php
Created November 12, 2013 18:52
Laravel 4 app/config/local/database.php. Local config options for laravel database.
<?php
return array(
'connections'=>array(
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'database',
@anglinb
anglinb / .ssh_sites
Created May 14, 2014 01:59
Super Simple SSH Server Manger
user1;192.191.123.121;hostname2;extra information goes here
root;192.168.112.121;hostname1;and here
@anglinb
anglinb / snippet.php
Created June 16, 2014 07:33
Helpful php stuff
$queries = DB::getQueryLog();
$last_query = end($queries);
return $last_query;
$cb = function($n){ return $n['id']; };
return array_map($cb, $orders->toArray());
@anglinb
anglinb / server.py
Created June 18, 2014 06:16
Uber simple cherrpy server for testing
import cherrypy
class HelloWorld(object):
@cherrypy.expose
def index(self):
return "Hello world!"
cherrypy.config.update({'server.socket_host': '127.0.0.1', 'server.socket_port': 8000, })
if __name__ == '__main__':
@anglinb
anglinb / test.json
Created June 23, 2014 23:17
Example json file
{"will":"it","do":"?"}
@anglinb
anglinb / stdclass.md
Created June 23, 2014 23:31
Python's equivalent of PHP's StdClass

You can use simple dynamic object instance with this command !

o = type('lamdbaobject', (object,), {})()

Like PHP StdClass, a usefull built-in lamdba object instance. Source

@anglinb
anglinb / content-single.php
Last active August 29, 2015 14:04
The Box Single Post Theme File
<?php
/**
* @package thebox
* @since thebox 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
8888888OZ7????????????????????????????????????????????7ZO888888
8888Z~....................................................~Z888
888Z:......................................................:Z88
88I..................................................,.......I8
8O:.................................................=........:O
87................................................==..........7
8?...............................................=?...........?
8I.............................,...............~$,............I
8I...........~:................+~............~$+..............I
@anglinb
anglinb / snapper
Created August 27, 2014 03:54
SnapSale
$
D
$
NZ
$$
$ $$
Z $ $$
$ $ $$
$Z $$ $$$
$$ $$$ 7$$7