Skip to content

Instantly share code, notes, and snippets.

View wayanjimmy's full-sized avatar
🏠
Working from home

Wayan jimmy wayanjimmy

🏠
Working from home
View GitHub Profile
@wayanjimmy
wayanjimmy / best_sublime
Created March 27, 2014 13:01
My favorite sublime
{
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
"tmp",
".bundle",
".sass-cache"
function contentData(){ // datatables processing
/* Array of database columns which should be read and sent back to DataTables. Use a space where
* you want to insert a non-database field (for example a counter or static image)
*/
$aColumns = array("'no'","data_tabel.id_konten","data_tabel.nama_kat","data_tabel.nama_konten","data_tabel.status_posting","'option'" );
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "data_tabel.id_konten";
/* DB table to use */
$aTable = array( "(SELECT a.id_konten, a.nama_konten, b.nama_kat, a.status_posting FROM tb_konten a
@wayanjimmy
wayanjimmy / RoomController
Created May 17, 2014 08:42
RoomController Example Laravel
<?php
class RoomController extends BaseController {
public function index()
{
$rooms = Room::all();
return View::make('admin.room.index', compact('rooms'));
}
@wayanjimmy
wayanjimmy / class user pegawai
Created June 13, 2014 07:26
class user pegawai
<?php
class UserPegawai extends User {
public function get_toko_bunga()
{
$q = "SELECT
a.id_tokobunga,
b.nama,
b.alamat,
@wayanjimmy
wayanjimmy / class.pecahtanggal.php
Created October 2, 2014 02:25
Class Pecah Tanggal
<?php
/*
*Kelas memecah format tanggal YYYY-MM-DD
*digunakan untuk menghitung JDN sebuah tanggal untuk dapat menghitung selisih antar 2 tanggal
*@author : Jimboy
*/
class PecahTanggal{
private $pecah;
private $hari;
@wayanjimmy
wayanjimmy / 0_reuse_code.js
Last active August 29, 2015 14:07
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
@wayanjimmy
wayanjimmy / contoh_upload_file_laravel.php
Created October 23, 2014 07:08
Contoh Upload File di Laravel
public function uploadLogo() {
$file = Input::file('logo');
$destinationPath = Lingkungan::$logoPath;
$filename = $file->getClientOriginalName();
$img = Image::make($file->getRealPath())->resize(150, 150)->save(public_path().$destinationPath.$filename);
if($img) {
return Response::json(['type' => 'success', 'full_filename' => asset($destinationPath.$filename), 'filename' => $filename]);
}else{
@wayanjimmy
wayanjimmy / php_ssh2_git_pull.php
Created October 29, 2014 07:05
Otomatisasi git pull dengan PHP ssh2_connect
<?php
if (!function_exists("ssh2_connect")) die("function ssh2_connect doesn't exist");
// log in at server1.example.com on port 22
if(!($con = ssh2_connect("host", "port"))){
echo "fail: unable to establish connection\n";
} else {
// try to authenticate with username root, password secretpassword
if(!ssh2_auth_password($con, "username", "password")) {
echo "fail: unable to authenticate\n";
@wayanjimmy
wayanjimmy / laravel_route_group_prefix.php
Created November 5, 2014 01:36
laravel route grouping with prefix
<?php
Route::group(array('prefix' => 'api/v1'), function(){
// routing here
});
@wayanjimmy
wayanjimmy / index.html
Created November 10, 2014 10:13
A Pen by Captain Anonymous.
<html>
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
</head>
<body>
<ul class="images-list list-unstyled">
<li>
<span class="header">