Skip to content

Instantly share code, notes, and snippets.

View fyulistian's full-sized avatar
💭
I may be slow to respond.

Fandi Yulistian fyulistian

💭
I may be slow to respond.
  • Aleph Labs
  • Centennial Tower 37th Floor Unit E Jl. Jenderal Gatot Subroto Kav. 24-25, Jakarta, Indonesia 12950
  • X @fyulistian
View GitHub Profile
@fyulistian
fyulistian / active-users.js
Last active September 18, 2017 06:09
Embed Google Analitycal
!function(t){function e(s){if(i[s])return i[s].exports;var n=i[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var i={};e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,s){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:s})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=2)}({2:function(t,e){gapi.analytics.ready(function(){gapi.analytics.createComponent("ActiveUsers",{initialize:function(){this.activeUsers=0,gapi.analytics.auth.once("signOut",this.handleSignOut_.bind(this))},execute:function(){this.polling_&&this.stop(),this.render_(),gapi.analytics.auth.isAuthorized()?this.pollActiveUsers_():gapi.analytics.auth.once("signIn",this.pollActiveUsers_.bind(this))},stop:function(){clearTimeout(this.timeout_),this.polling_=!1,this.emit("stop",{activeUsers:this.activeUsers})},render_:function(){var t=this.get(
@fyulistian
fyulistian / db_daerah_indonesia.sql
Created October 26, 2017 07:04
SQL daerah Indonesia
This file has been truncated, but you can view the full file.
CREATE DATABASE IF NOT EXISTS db_daerah_indonesia;
USE db_daerah_indonesia;
DROP TABLE IF EXISTS jenis;
CREATE TABLE IF NOT EXISTS jenis (
id_jenis int(11) NOT NULL,
nama tinytext NOT NULL
);
@fyulistian
fyulistian / Preferences.sublime-settings
Last active November 10, 2017 11:46
My sublime setting for php developer.
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme",
"font_face": "Roboto Mono",
"font_options":
[
"gray_antialias",
"subpixel_antialias"
],
@fyulistian
fyulistian / remove-zeros.js
Last active July 16, 2018 10:25
Remove zero on first letter (numeric) by event key_up
/**
* Event on change poin
*/
var RmvZeros = function () {
$('#number-field').on('keyup', function() {
var reg = /^0+/gi; // search zero on first letter by regex
// find the zero than remove
if (this.value.match(reg)) {
@fyulistian
fyulistian / empty.js
Created July 16, 2018 10:21
Checking empty object, empty string, undefined by jQuery
// function for check empty by data type
var is_empty = function(data) {
// data type object
if (typeof(data) === 'object') {
// check empty for data object
if (JSON.stringify(data) === '{}' || JSON.stringify(data) === '[]'){
return true;
} else if(!data) {
return true;
}
@fyulistian
fyulistian / formatted-number-field.js
Created July 16, 2018 10:24
Return returning only number by javascrip with regex
// function typing always return number with regex
function formattedNumberField (selector = ".formattedNumberField") {
$(selector).on('keyup', function() {
/**
* Regular Expression.
* ref.
* https://regex101.com
*
* @type {RegExp}
*/
@fyulistian
fyulistian / comingsoon.html
Last active July 25, 2018 10:12
HTML CSS Coming Soon
<!DOCTYPE html>
<html lang='en'>
<head>
<!-- Source -->
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!-- Google Fonts -->
@fyulistian
fyulistian / check-recheck.js
Created July 26, 2018 06:04
jQuery checkbox check all, but if one not checked, primary checkbox become uncheck
// document ready
$(document).ready(function() {
// event on change
$(document).on("change","#box-all",function() {
// check all
if(this.checked) {
$(".box-single").each(function() {
this.checked = true;
})
@fyulistian
fyulistian / data.js
Created July 31, 2018 09:17
Highcharts with 3 level
$(function () {
// create the chart
$('#container').highcharts({
chart: { type: 'column' }, // type charts
title: { text: '3 Level Charts' }, // title of charts
xAxis: { type: 'category' }, // x Axis
legend: { enabled: false }, // rule of legend
@fyulistian
fyulistian / number-decimal.js
Created August 14, 2018 08:03
Thousand separator with decimal on typing
var element = '#numberFormattedWithDecimal';
$(element).keyup(function(event) {
/**
* Regular Expression.
* ref.
* https://regex101.com
*
* @type {RegExp}
*/