Skip to content

Instantly share code, notes, and snippets.

View andremahendra's full-sized avatar

Kadek Andre Mahendra andremahendra

  • Bali
View GitHub Profile
@andremahendra
andremahendra / countryCode.json
Last active April 29, 2019 13:51
Country Code
[
{
"name":"Israel",
"dial_code":"+972",
"code":"IL"
},
{
"name":"Afghanistan",
"dial_code":"+93",
"code":"AF"
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
https://gist.github.com/joyrexus/7307312
https://blog.garstasio.com/you-dont-need-jquery/dom-manipulation/
https://blog.garstasio.com/you-dont-need-jquery/selectors/
@andremahendra
andremahendra / sticky-with-limit
Created April 11, 2017 06:08
sticky element with limit
// write on ES, to write on ES5 change "let" to var
// only for static element with sticky
// TODO: make reusable
$(document).ready(function () {
let el = $('.dynamic-aside-menus')
let elWidth = $('.dynamic-aside-menus').width(el.parent().width())
let elHeight = $('.dynamic-aside-menus').height()
let elPos = el.offset()
@andremahendra
andremahendra / onclick-goto-target-div
Created April 11, 2017 04:20
on click element go to target div
// reference: http://stackoverflow.com/questions/27554831/javascript-scroll-to-element-with-animation-onclick
$('.go--to').click(function () {
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top - 90
}, 1000);
@andremahendra
andremahendra / phpstorm-and-webstorm-file-watcher-scss-setting-on-mac.txt
Last active April 4, 2017 05:37
PHPStorm and WebStorm File watcher SCSS setting (on Mac)
/**
* PHPStorm and WebStorm File watcher SCSS setting (on Mac)
*/
// program
/usr/local/bin/sassc
// arguments
--precision 10 --sourcemap $FileName$ $FileNameWithoutExtension$.css