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 / paginated_collection.js
Created October 6, 2012 10:52 — forked from io41/paginated_collection.js
Pagination with Backbone.js
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage');
typeof(options) != 'undefined' || (options = {});
this.page = 1;
typeof(this.perPage) != 'undefined' || (this.perPage = 10);
},
fetch: function(options) {
@jpalala
jpalala / gist:3851248
Created October 8, 2012 07:49 — forked from vinhboy/gist:1274476
Testing backbone js powered shopping cart
<html>
<body>
<table id="cart">
<thead>
<tr>
<th></th>
<th>Price/Bottle</th>
<th>Quantity</th>
<th>Total</th>
</tr>
@jpalala
jpalala / Roadblocks_to_learning.md
Created October 9, 2012 06:20
ROADBLOCKS TO LEARNING

================= ROADBLOCKS TO LEARNING NEW THINGS ============

The feeling that it might be very difficult to learn new things. The thinking that we have a limited brain capacity for absorbing new things.

-> This is not true. What makes a person absorb new things is the GROWTH mindset.

-> Think of the brain like a muscle, that you need to keep growing your knowledge by exercising it.

a{
border-radius:10px;
background:#efefef;
color:blue;
font-size: 12px;
padding:5px 16px 5px 16px;
margin: 10px;
line-height:90%;
}
The procedure for setting up automatic private/public key login on our servers is as follows:
- On your own machine, go to $HOME/.ssh and type: ssh-keygen -t dsa
- When prompted for it, leave the default location for the file and let the passphrase empty
- Copy the content of the "id_dsa.pub" file that just got created into the $HOME/.ssh/authorized_keys and authorized_keys2 on our machine.
- Set the following permissions:
chmod 644 $HOME/.ssh/authorized_keys*
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 {
@jpalala
jpalala / hr_requirements_checker.py
Created February 11, 2014 04:06
HR_Requirements_Submit.py
import ('transcript.doc') from alma-mater;
import('sss/tin') from govt;
import('certificates') from employers;
passed_requirements = ['sss', 'tin', 'transcript'];
requirementslist = ['certificates','sss','tin','transcript','philhealth','pagibig'];
requirements_complete = raw_input("Enter Percent Complete");
if ( passed_requirements in requirementslist) && requirements_complete > 50% ) :
echo "semi-accepted. If requirements are incomplete, please pass ASAP";
@jpalala
jpalala / community.php
Last active August 29, 2015 13:59
EdenPHP - how to get FQL of group posts (group stream)
<?php
//...public function render() {
$fql = eden('facebook')->fql('YOUR-FB-TOKEN-HERE');
$this->_body['posts'] = $fql->search('message')
->setTable('stream')
->addFilter('source_id = 676736705716981') //mentorsdojo community group id
// ->debug(true) // (for debugging purpose)
->getRows();
@jpalala
jpalala / Author_Glu.php
Last active July 30, 2024 03:10
Author_Glu - a simple class to output author html example
<?php
class Author_Glu {
public $html;
public function __construct($obj) {
$this->html = '<div class="author-name" data-detail="' . substr(0,150,$obj->bio) . '">' . $obj->firstname . ' ' . $obj->lastname . '</div>';
}
public function __toString() {
@jpalala
jpalala / wp.class.php
Created April 21, 2014 05:22
simple wp wrapper - for external systems
<?php
class WPObj {
public $db;
public $prf;
public function __construct($pdoDB,$prefix = NULL) {
// save db object to our class
$this->db = $pdoDB;
if(!$prefix)