Skip to content

Instantly share code, notes, and snippets.

Awesome PHP Libraries

A list of amazingly awesome PHP libraries that you should consider using (and some other shiny extras).

@phucpnt
phucpnt / README.md
Last active December 18, 2015 23:49 — forked from mbostock/.block
@phucpnt
phucpnt / gist:9226539
Last active August 29, 2015 13:56 — forked from jmertic/gist:6294266
SugarCRM install module by command line
#!/usr/bin/env php
<?php
function usage()
{
print("usage: -i /path/to/instance -p /path/to/expanded/module -z /path/to/zipfile\n");
exit(1);
}
$opts = getopt('i:p:z:');
@phucpnt
phucpnt / repair.php
Created February 26, 2014 09:58 — forked from chicks/repair.php
#! /usr/bin/env php
<?php
# Stuff we have to do
if(!defined('sugarEntry'))define('sugarEntry', true);
function usage() {
global $argv;
return "\n" . $argv[0] . " <path to sugar>\n";
}
@phucpnt
phucpnt / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
//Automatically login a single WordPress user upon arrival to a specific page.
//Redirect to home page once logged in and prevent viewing of the login page.
//Tested with WP 3.9.1. Used in functions.php
//Updated 2014-07-18 to resolve WP_DEBUG notice: "get_userdatabylogin is deprecated since version 3.3! Use get_user_by('login') instead."
//From http://tourkick.com/2014/wordpress-demo-multisite-db-reset/
function auto_login() {
//change these 2 items
$loginpageid = '1234'; //Page ID of your login page
@phucpnt
phucpnt / index.html
Created May 16, 2016 21:31 — forked from mhkeller/index.html
Sample d3 gantt chart, sorting works, filtering broken
<title>Ganttttttttttttt</title>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.2/underscore-min.js"></script>
<style>
.axis path,
.axis line {
fill: none;
stroke: none;
shape-rendering: crispEdges;
@phucpnt
phucpnt / requireNoCache.js
Created July 9, 2016 02:36 — forked from adam-lynch/requireNoCache.js
Require a module, without going to Node.js's require cache
var path = require('path');
var _invalidateRequireCacheForFile = function(filePath){
delete require.cache[path.resolve(filePath)];
};
var requireNoCache = function(filePath){
_invalidateRequireCacheForFile(filePath);
return require(filePath);
};