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

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",
@jenalgit
jenalgit / index.html
Created March 25, 2018 11:31 — forked from nithinbekal/index.html
HTML5 Todo App source
<!doctype html>
<html>
<head>
<title>My Todo List</title>
<style>
body { background: #0f0f0f; font-family: Tahoma, sans-serif; font-size: 11px; }
header, section, footer { display: block; }
#container { background-color: #eee; margin: 0 auto; width: 300px; border: 4px solid #222; }
header h1 { text-align: center; margin: 0; padding: 15px 0;}
label { display: block; padding-bottom: 5px; text-align: center; }
@jenalgit
jenalgit / index.php
Created March 20, 2018 05:56 — forked from ziadoz/index.php
Simple PHP / jQuery CSRF Protection
<?php
// See: http://blog.ircmaxell.com/2013/02/preventing-csrf-attacks.html
// Start a session (which should use cookies over HTTP only).
session_start();
// Create a new CSRF token.
if (! isset($_SESSION['csrf_token'])) {
$_SESSION['csrf_token'] = base64_encode(openssl_random_pseudo_bytes(32));
}