Skip to content

Instantly share code, notes, and snippets.

View zhiephie's full-sized avatar
:octocat:
Focusing

Yudi Purwanto zhiephie

:octocat:
Focusing
View GitHub Profile
—– BEGIN LICENSE —–
K-20
Single User License
EA7E-940129
3A099EC1C0B5C7C5 33EBF0CF BE82FE3B
<?php
class File {
public function read_all($file) {
if (!isset($file) || !file_exists($file)) {
return false;
}
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail
# Make sure you have IMAP enabled in your gmail settings.
# Right now it won't download same file name twice even if their contents are different.
import email
import getpass, imaplib
import os
import sys
detach_dir = '.'
@zhiephie
zhiephie / hello.js
Last active August 29, 2015 14:20
MeteorRest
Hello = new Mongo.Collection('hello');
if(Meteor.isServer) {
// Global API configuration
Restivus.configure({
useAuth: true,
prettyJson: true
});
@zhiephie
zhiephie / upload.php
Last active August 29, 2015 14:23 — forked from msurguy/upload.php
ini_set("memory_limit","200M");
if( !empty($_SERVER['HTTP_ORIGIN']) ){
// Enable CORS
header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
header('Access-Control-Allow-Methods: POST, GET, OPTIONS');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Range, Content-Disposition, Content-Type');
}
if( $_SERVER['REQUEST_METHOD'] == 'OPTIONS' ){

Did I hear you wanted AJAX charts instead of hard coded? You got it.

Follow this guide to integrate bar chart reports into your Laravel application with AJAX. Reports like the following come with this guide:

  • Total number of Orders by day
  • Total number of Users subscribed by day
  • etc

The library used for the charts is: http://www.oesmith.co.uk/morris.js/

@zhiephie
zhiephie / README.md
Last active August 29, 2015 14:24 — forked from denji/readme-php7.md

Quick install PHP 7.0 (phpng):

1. Install depends PHP 7.0 (phpng)
$ brew install autoconf automake bison27 gd freetype t1lib mariadb gettext zlib mcrypt
Add support for Bison 3.x

curl -L https://github.com/php/php-src/pull/685.diff | patch -p1

@zhiephie
zhiephie / usertracking.php
Last active October 2, 2015 10:11
revisi code mu, di PHP 5.6 parent::__construct di hapus. Dan bagian config/hooks.php rubah bagian ini 'class' => 'Usertracking',
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Usertracking Class
*
* @package CodeIgniter
* @subpackage Hook
* @category Usertracking
* @author zhiephie
*/
class Usertracking {
@zhiephie
zhiephie / app.js
Created October 4, 2015 13:55
contoh
var app = angular.module("app", ["ngRoute"]);
app.config(['$routeProvider',function($routeProvider)
{
$routeProvider.when("/home", {
templateUrl: "templates/home.html",
controller: "homeCtrl"
})
.when("/about", {
templateUrl: "templates/about.html",
@zhiephie
zhiephie / static_server.js
Last active October 12, 2015 16:48 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);