Skip to content

Instantly share code, notes, and snippets.

View jenalgit's full-sized avatar
💭
I may be slow to respond. Lagi sibuk soalnya,,, sibuk ngopi 💃

jenal jenalgit

💭
I may be slow to respond. Lagi sibuk soalnya,,, sibuk ngopi 💃
View GitHub Profile
@jenalgit
jenalgit / select2-cascade.js
Created May 8, 2018 08:28 — forked from ajaxray/ select2-cascade.js
Making Select2 (4.x) list boxes cascading / dependent. Options of a select2 list box will be loaded/refreshed by ajax based on selection of another select2 list box.
/**
* A Javascript module to loadeding/refreshing options of a select2 list box using ajax based on selection of another select2 list box.
*
* @url : https://gist.github.com/ajaxray/187e7c9a00666a7ffff52a8a69b8bf31
* @auther : Anis Uddin Ahmad <anis.programmer@gmail.com>
*
* Live demo - https://codepen.io/ajaxray/full/oBPbQe/
* w: http://ajaxray.com | t: @ajaxray
*/
var Select2Cascade = ( function(window, $) {

[abc] A single character: a, b or c
[^abc] Any single character but a, b, or c
[a-z] Any single character in the range a-z
[a-zA-Z] Any single character in the range a-z or A-Z
^ Start of line
$ End of line
\A Start of string
\z End of string
. Any single character
\s Any whitespace character

This is a crash course in JavaScript. It is intended for people who already have a bit of programming experience in other languages.

This will hopefully give a basic idea of the most-commonly-used language features, but it is not indended to be a comprehensive guide.

This guide was last updated in August 2016.

Basic syntax

To declare a variable called foo:

@jenalgit
jenalgit / dnscrypt.csv
Created April 10, 2018 02:27 — forked from lenage/dnscrypt.csv
DNScrypt server list
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 14 columns, instead of 6 in line 4.
Name,Full name,Description,Location,Coordinates,URL,Version,DNSSEC validation,No logs,Namecoin,Resolver address,Provider name,Provider public key,Provider public key TXT record
4armed,4ARMED,DNSCrypt Server provided by www.4armed.com,France,,https://www.4armed.com,1,yes,yes,no,51.254.115.48:443,2.dnscrypt-cert.dnscrypt.4armed.io,FD3E:5887:63EA:17A9:1AF8:4325:DE82:1507:6ED0:01AB:2F9E:55DE:689B:F491:4D8E:526E,
cisco,Cisco OpenDNS,Remove your DNS blind spot,Anycast,,https://www.opendns.com,1,no,no,no,208.67.220.220:443,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,
cisco-familyshield,Cisco OpenDNS with FamilyShield,Blocks web sites not suitable for children,Anycast,,https://www.opendns.com/home-internet-security/parental-controls/,1,no,no,no,208.67.220.123:443,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,
cisco-ipv6,Cisco OpenDNS over IPv6,Cisco OpenDNS IPv6 sandbox,Anycast,,https://www.op
@jenalgit
jenalgit / index.html
Created April 5, 2018 21:42 — forked from milkbread/index.html
HTML: D3 Geodata Basics - example for the tutorial on digital-geography
<!DOCTYPE html>
<html>
<head>
<title>Testmap</title>
<meta charset="utf-8" />
<script src="http://cdn.leafletjs.com/leaflet-0.6.1/leaflet.js"></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="roads.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<style>
@jenalgit
jenalgit / index.html
Created April 5, 2018 10:46 — forked from caged/index.html
Plot vector points on a cropped raster image with d3.js
<!doctype html>
<meta charset="utf-8">
<body>
<style media="screen">
body {
margin: 0;
}
.supermarket {
fill: red;
@jenalgit
jenalgit / .block
Created April 5, 2018 10:45 — forked from anonymous/.block
Plotting points on a map in D3
license: mit
@jenalgit
jenalgit / index.html
Created April 5, 2018 10:26 — forked from phil-pedruco/index.html
Plotting points on a map in D3
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Point on a map D3</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<style type="text/css">
@jenalgit
jenalgit / README.md
Created April 5, 2018 10:25 — forked from johardi/README.md
Indonesia ADM2

The topology information contains the boundary lines between regencies ("kabupaten@id") in the Indonesian teritory. The process for producing the output file id.json follows the commands below. Note that before executing topojson, I simplified the map in http://www.mapshaper.org/ by 0.30%. The final file sizes 216 KB with decent details for overviewing.

$ ogr2ogr -f GeoJSON regency.json IDN_adm2.shp

// Upload regency.json to mapshaper.org
@jenalgit
jenalgit / write-json-file.php
Created March 26, 2018 09:06 — forked from tutweb/write-json-file.php
Write JSON file with PHP
<?php
// array
$array = Array (
"0" => Array (
"id" => "USR1",
"name" => "Steve Jobs",
"company" => "Apple"
),
"1" => Array (
"id" => "USR2",