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
/*Profile node helps to segragate the actual query sql from the model code*/ | |
class Profile_node { | |
public $CInst; | |
private $dB; | |
public $profile_id; | |
public $social_keys; | |
public function __construct($profile_id) { | |
$this->CInst =& get_instance(); | |
$this->dB = $this->CInst->db->database; |
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
# will rewrite strip out www | |
server { | |
server_name www.example.com; | |
rewrite ^(.*) http://example.com$1 permanent; | |
} | |
# statements for each of your virtual hosts to this file | |
server { | |
listen 80; ## listen for ipv4; this line is default and implied |
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
header { background:#000 } | |
header, .container { position: relative; width: 1920px; margin: 0 auto; padding: 0; } | |
header .column, header .columns { float: left; display: inline; margin-left: 20px; margin-right: 20px; } | |
.container .column, .container .columns { float: left; display: inline; margin-left: 20px; margin-right: 20px; } | |
.row { margin-bottom: 20px; } | |
/* Nested Column Classes */ | |
.column.alpha, .columns.alpha { margin-left: 0; } |
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
yApp = { | |
init: function() { | |
} | |
} | |
Modernizr.load({ | |
test: Modernizr.geolocation && Modernizr.fontface && Modernizr.canvas && Modernizr.cssgradients, | |
yep : 'geo.js', | |
nope: ['geo-polyfill.js','presentational-polyfill.js', 'presentational.css'] | |
}, |
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/python | |
import os, sys | |
import getopt | |
"""TODO: upload to idonethis.com [feature]""" | |
"""TODO: check if git repository (no dones will be posted if not a repo) [improvement]""" | |
def main(): | |
"""remove file DONE.THIS.md if it exists""" | |
try: |
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
# see blog post: http://blog.jpalala.com/content/my-git-workflow-solo-development | |
cd ~ | |
mkdir -p gitrepos/projectname.git | |
cd gitrepos/projectname.git | |
git init --bare --shared=group | |
#Initialized empty shared Git repository in repositories/project.git/ |
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
//sample ajax call in page | |
(function($){ | |
$.ajax({ | |
type: 'GET', | |
url:'/posts', | |
dataType: 'json', | |
success: function(data) { | |
$.each(data, function(i, item) { | |
$('.container').append('<h2>' + data[i].title + '</h2>'); | |
}); |
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
server { | |
server_name [host]; | |
root /var/www/[document_root]; ## <-- Your only path reference. | |
# Enable compression, this will help if you have for instance advagg module | |
# by serving Gzip versions of the files. | |
gzip_static on; | |
location = /favicon.ico { |
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
There are a lot of complaints going around about Laravel these days, but a lot | |
of the important ones seem to be missing from the spotlight. | |
Bugfixes, issues and pull requests being left open for months with no | |
clarification of intent: | |
- https://github.com/laravel/framework/pull/1799 | |
- https://github.com/laravel/framework/issues/1963 | |
- https://github.com/laravel/framework/issues/2089 | |
- https://github.com/laravel/framework/issues/2234 |
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/python | |
from time import mktime, gmtime, strftime, time | |
import datetime | |
log = '/var/log/nginx/logs/access_log' | |
num_lines = 0 | |
num_words = 0 | |
with open(log, 'r') as f: |