Skip to content

Instantly share code, notes, and snippets.

View jpalala's full-sized avatar
🎯
Focusing

Jose Palala jpalala

🎯
Focusing
View GitHub Profile
@jpalala
jpalala / profile_entitynode.php
Created April 28, 2014 01:09
Some entity based table design idea i have
/*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;
@jpalala
jpalala / example-edenphp.com.conf
Last active August 29, 2015 14:00
Eden-PHP Nginx Config
# 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
@jpalala
jpalala / 1920.css
Created May 21, 2014 08:06
skeletoncss framework 1920 pixel gs for large screens
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; }
@jpalala
jpalala / mdern.js
Created May 25, 2014 05:00
modernizer_script_beginners
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']
},
@jpalala
jpalala / todond.py
Last active August 29, 2015 14:06
TODON(e)D - simple way to record your git logs as a DONETHIS file and put in your TODO.md list
#!/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:
@jpalala
jpalala / git-remote-setup.sh
Last active October 1, 2015 00:53
Setting up a local repo on your server
# 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/
@jpalala
jpalala / zepto-ajax-querying.js
Created October 7, 2014 09:55
fun with Zepto.ajax()
//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>');
});
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 {
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
@jpalala
jpalala / log_summarizer.py
Last active August 29, 2015 14:07
find out how many hits from a nginx log or apache log by writing a summarized log file
#!/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: