This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ic = '090303086521'; | |
if(ic.match(/^(\d{2})(\d{2})(\d{2})-?\d{2}-?\d{4}$/)) { | |
var year = RegExp.$1; | |
var month = RegExp.$2; | |
var day = RegExp.$3; | |
console.log(year, month, day); | |
var now = new Date().getFullYear().toString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == ""){ | |
$redirect = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; | |
header("Location: $redirect"); | |
} | |
class Host { | |
private $ip; | |
private $hosts; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function string_to_slug (str) { | |
str = str.replace(/^\s+|\s+$/g, ''); // trim | |
str = str.toLowerCase(); | |
// remove accents, swap ñ for n, etc | |
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;"; | |
var to = "aaaaeeeeiiiioooouuuunc------"; | |
for (var i=0, l=from.length ; i<l ; i++) { | |
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Call this with the shown parameters (make sure $time and $end are integers and in Unix timestamp format!) | |
//Get a link that will open a new event in Google Calendar with those details pre-filled | |
function make_google_calendar_link($name, $begin, $end, $location, $details) { | |
$params = array('&dates=', '/', '&details=', '&location=', '&sf=true&output=xml'); | |
$url = 'https://www.google.com/calendar/render?action=TEMPLATE&text='; | |
$arg_list = func_get_args(); | |
for ($i = 0; $i < count($arg_list); $i++) { | |
$current = $arg_list[$i]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error_page 500 /500.html; | |
location /500.html{ | |
return 500 '{"error": {"status_code": 500,"status": "Internal Server Error"}}'; | |
} | |
error_page 502 /502.html; | |
location /502.html{ | |
return 502 '{"error": {"status_code": 502,"status": "Bad Gateway"}}'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# PATH TO YOUR HOSTS FILE | |
ETC_HOSTS=/etc/hosts | |
# DEFAULT IP FOR HOSTNAME | |
IP="127.0.0.1" | |
# Hostname to add/remove. | |
HOSTNAME=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Our demo fragment | |
*/ | |
public static class CircularRevealingFragment extends Fragment { | |
OnFragmentTouched listener; | |
public CircularRevealingFragment() { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Fpx { | |
public $merchant_id; | |
public $prefix; | |
public $order_number; | |
public $user_email; | |
public $description; | |
public $amount; | |
public $exchange_id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"prepared_by": "Zulhilmi Zainudin", | |
"last_update": "21 June 2016", | |
"data": [ | |
{ | |
"state": "Selangor", | |
"codes": [ | |
"40000", | |
"40100", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers\Auth; | |
use App\Http\Controllers\Controller; | |
use App\Transformers\Json; | |
use App\User; | |
use Illuminate\Foundation\Auth\SendsPasswordResetEmails; | |
use Illuminate\Http\Request; |
OlderNewer