Skip to content

Instantly share code, notes, and snippets.

@phucpnt
phucpnt / fiddle.css
Created January 3, 2013 03:01
Display unordered list in 2 cols
.highlight_list li{
display:inline-block;
vertical-align: top;
width: 45%;
}​

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 / dabblet.css
Last active December 18, 2015 23:49
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@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 / InstagramOAuth2Service.php
Last active October 14, 2015 03:48
yii2-eauth instagram oauth2 service
<?php
/**
* @author PhucPNT. <mail@phucpnt.com>
*/
namespace nodge\eauth\services;
use nodge\eauth\oauth2\Service;
use OAuth\Common\Token\TokenInterface;
use OAuth\OAuth2\Service\ServiceInterface;