Skip to content

Instantly share code, notes, and snippets.

View no-problemo's full-sized avatar

no problemo no-problemo

View GitHub Profile
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/statis.*$
RewriteRule .* rute.php [L,QSA]
@no-problemo
no-problemo / longpoll.html
Last active February 2, 2016 15:44
node.js aplikasi chat
<html>
<head>
<title>chat</title>
<style>
iframe{display:none}
#komen{display:none}
</style>
</head>
<body>
<h3>chat</h3>
@no-problemo
no-problemo / A.html
Last active January 18, 2016 13:50
membuat webserver node.js sederhana
<html>
<head>
<title>A</title>
</head>
<body>
<form method="POST" action="/validasiA">
angka:<input name="angka"><br>
<input type="submit" value="kirim">
</form>
<script>
@no-problemo
no-problemo / How_to_use.html
Created December 2, 2015 05:29 — forked from jcgregorio/How_to_use.html
HTML Templating using the HTML <template> element and exactly 100 lines of JS.
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script src="templating.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<template id=t>
@no-problemo
no-problemo / introrx.md
Created November 25, 2015 11:12 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@no-problemo
no-problemo / webserver.js
Last active November 8, 2015 04:44
NODE.JS . contoh pemakaian http request method GET & POST sesuai dengan fungsinya :
function template(template){
var tmplt=template.split(/<!--([^-]+)-->/g),len=tmplt.length;
return function(respon,obyek){
for(var idx=0;idx<len;idx++){
respon.write(idx&1?''+obyek[tmplt[idx]]:tmplt[idx])
}
respon.end()
}
}
@no-problemo
no-problemo / fast-bind.js
Last active September 15, 2015 04:30 — forked from WebReflection/fast-bind.js
Function.prototype.bind performance problem solved in JS … (at least for 90% of common cases without partial args)
/*jslint indent: 2 */
(function (FunctionPrototype) {
'use strict';
var originalBind = FunctionPrototype.bind;
if (!originalBind.patched) {
Object.defineProperty(
FunctionPrototype,
'bind',
{
configurable: true,
(function(window, document, JSON){
"use strict";
var SEP = '|', ua, opera, ie;
/*
* Collect Browser & Device Data
*/
var Collector = {
/*
* MD5 Checksum calculation
*/
@no-problemo
no-problemo / notes.md
Last active August 29, 2015 14:22 — forked from addyosmani/notes.md

Re: http://blog.chromium.org/2015/03/new-javascript-techniques-for-rapid.html

V8 Optimisations to enable fast page startup

As mentioned in our Chromium blog post, Chrome 41 introduces support for streaming parsing of JavaScript files using the async or deferred attributes. This is where the V8 parser will parse any incoming JavaScript piece-by-piece so the compiler can immediately begin compiling the AST when script loading has completed. This lets us do something useful while waiting for the page to load. Compare:

This means parsing can be removed from the critical path when loading up the page. In these cases such scripts are parsed on a separate thread as soon as the download begins, allowing parsing to complete very soon after the download has completed (milliseconds), leading to pages (potentially) loading much faster.

Deploy your own PaaS!

Setting up Dokku with DigitalOcean and Namecheap

..or how I made my own heroku in a few hours for $3.98.

This write-up owes a great deal to dscape's Node.js Deployments with Docker, Dokku, & Digital Ocean, the dokku project itself, and the fine folks working on dokku's issues. I took dscape's article as a starting point when trying this out but found some details lacking so I documented my own process for getting dokku up and running.

1. Get a domain