Skip to content

Instantly share code, notes, and snippets.

View tesarwijaya's full-sized avatar

Tesar Wijaya tesarwijaya

  • Jakarta, Indonesia
View GitHub Profile
package main
import "fmt"
// Node ...
type Node struct {
Data interface{}
Left *Node
Right *Node
}
@tesarwijaya
tesarwijaya / queue.go
Last active December 7, 2019 15:53
Queue
package main
import "fmt"
// Queue ...
type Queue struct {
Head int
Tail int
Size int
Items []interface{}
@tesarwijaya
tesarwijaya / stack.go
Created December 7, 2019 14:47
Stack
package main
import "fmt"
// Stack ...
type Stack struct {
Items []int64
Top int
}
@tesarwijaya
tesarwijaya / gdrive_upload_folder.py
Created September 14, 2017 15:53 — forked from jmlrt/gdrive_upload_folder.py
Python script to upload folder to Google Drive
# -*- coding: utf-8 -*-
"""
Upload folder to Google Drive
"""
# Enable Python3 compatibility
from __future__ import (unicode_literals, absolute_import, print_function,
division)
<?php
namespace App\Http\Controllers;
use App\Locations;
use App\History;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\DB;
use DateTime;
use DateInterval;
@tesarwijaya
tesarwijaya / get.js
Created July 21, 2017 15:53
jquery get data
$.get( "example.php", function(response) {
console.log(response.data)
alert( "success" );
})
.done(function() {
alert( "second success" );
})
.fail(function() {
alert( "error" );
})
@tesarwijaya
tesarwijaya / responsive.css
Created July 17, 2017 14:34
responsive css on 12 col based
.row {
display: block;
padding-right: 35px;
padding-left: 35px;
clear:both;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@tesarwijaya
tesarwijaya / request.js
Created July 17, 2017 04:32
How to get a new token after token expired in axios
import axios from 'axios'
import store from '../store'
import qs from 'qs'
export const http = axios.create({
baseURL: 'http://localhost:8000/api/',
header: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
@tesarwijaya
tesarwijaya / CorsMiddleware.php
Created June 8, 2017 04:12
enabling CORS in lumen middleware
<?php
namespace App\Http\Middleware;
use Closure;
class CorsMiddleware {
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request