This file contains hidden or 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
/******************************************************* | |
* #### nik_parse.js #### | |
* Parse & Validasi Nomor Induk Kependudukan (NIK) KTP | |
* Coded by @bachors 2018. | |
* https://github.com/bachors/nik_parse.js | |
* Updates will be posted to this site. | |
*******************************************************/ | |
// example: | |
// const nik = "3204110609970001"; |
This file contains hidden or 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
window.addEventListener('error', function (e) { | |
ga('send', 'exception', { | |
exDescription: 'JavaScript Error ' + e.message + ' ' + e.filename + ': ' + e.lineno | |
}); | |
}); | |
jQuery(document).ajaxError(function (e, request, settings) { | |
ga('send', 'exception', { | |
exDescription: 'Ajax Error ' + settings.url + ' ' + e.result | |
}); | |
}); |
This file contains hidden or 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 | |
function dateIndonesia($formatedDate) { | |
$patterns = array( | |
'/January/' => 'Januari', | |
'/February/' => 'Februari', | |
'/March/' => 'Maret', | |
'/May/' => 'Mei', | |
'/June/' => 'Juni', | |
'/July/' => 'Juli', |
This file contains hidden or 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
# copy code below to your hosts file | |
## BEGIN BLOCK ADS | |
127.0.0.1 ad.atdmt.com | |
127.0.0.1 adclick.g.doublecklick.net | |
127.0.0.1 adeventtracker.spotify.com | |
127.0.0.1 adlab.spotify.com | |
127.0.0.1 adnxs.com | |
127.0.0.1 adnxs.comadplexmedia.adk2x.com | |
127.0.0.1 ads-akp.spotify.com |
This file contains hidden or 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
let regex; | |
/* matching a specific string */ | |
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello" | |
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO" | |
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes... | |
/* wildcards */ | |
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo" | |
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo" |
This file contains hidden or 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
# ... your Python code | |
def getDataframeInfo(df): | |
dfInfo = pd.DataFrame(data={'DataFeatures':list(df)}) | |
dfInfo['DataType'] = dfInfo['DataFeatures'].apply(lambda col: df.dtypes[col]) | |
dfInfo['Null'] = dfInfo['DataFeatures'].apply(lambda col: df[col].isnull().sum(axis='index')) | |
dfInfo['NullPercentage'] = dfInfo['Null'].apply(lambda nullCount: nullCount / df.shape[0]) | |
dfInfo['Unique'] = dfInfo['DataFeatures'].apply(lambda col: df[col].nunique()) | |
dfInfo['UniqueSample'] = dfInfo['DataFeatures'].apply(lambda col: df[col].unique()[0:5]) |
This file contains hidden or 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 | |
// ... | |
$query = User::select('username'); | |
$sql = str_replace('?', '\'%s\'', str_replace('%', '%%', $query->toSql())); | |
$sql = vsprintf($sql, $query->getBindings()); | |
die($sql); |
This file contains hidden or 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 | |
// Output screenshot: | |
// http://cl.ly/NsqF | |
// ------------------------------------------------------- | |
include_once 'console.php'; | |
// ::log method usage | |
// ------------------------------------------------------- | |
Console::log('Im Red!', 'red'); |
This file contains hidden or 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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-field/core-field.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../core-input/core-input.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> |
This file contains hidden or 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 isMobile = { | |
Android: function() { | |
return navigator.userAgent.match(/Android/i); | |
}, | |
BlackBerry: function() { | |
return navigator.userAgent.match(/BlackBerry/i); | |
}, | |
iOS: function() { | |
return navigator.userAgent.match(/iPhone|iPad|iPod/i); | |
}, |
NewerOlder