Skip to content

Instantly share code, notes, and snippets.

View adisetiawan's full-sized avatar
🏠
Working from home

Adi adisetiawan

🏠
Working from home
View GitHub Profile
"""Async and await example using subprocesses
Note:
Requires Python 3.6.
"""
import sys
import time
import platform
import asyncio
<!DOCTYPE html>
<html>
<body>
<!-- 1. The <iframe> (and video player) will replace this <div> tag. -->
<div id="player"></div>
<div>Current Time: <span id="time"></span></div>
<script>
// 2. This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
@adisetiawan
adisetiawan / gammu-install-osx.md
Created July 8, 2020 05:22 — forked from tomysmile/gammu-install-osx.md
Gammu: Install on OSX 10.11 with Wavecom Modem M1306B

Configuring Gammu for Mac OSX 10.11

Requirements

Step by step:

  • Type below command :
@adisetiawan
adisetiawan / slugify.js
Created February 25, 2019 05:15 — forked from hagemann/slugify.js
Slugify makes a string URI-friendly
function slugify(string) {
const a = 'àáäâãåăæçèéëêǵḧìíïîḿńǹñòóöôœṕŕßśșțùúüûǘẃẍÿź·/_,:;'
const b = 'aaaaaaaaceeeeghiiiimnnnoooooprssstuuuuuwxyz------'
const p = new RegExp(a.split('').join('|'), 'g')
return string.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(p, c => b.charAt(a.indexOf(c))) // Replace special characters
.replace(/&/g, '-and-') // Replace & with 'and'
.replace(/[^\w\-]+/g, '') // Remove all non-word characters
@adisetiawan
adisetiawan / Email Server (Linux, Unix, Mac).md
Created September 13, 2018 05:18 — forked from raelgc/Email Server (Linux, Unix, Mac).md
Setup a Local Only Email Server (Linux, Unix, Mac)

Setup a Local Only Email Server (Linux, Unix, Mac)

1 - Point localhost.com to your machine

Most of programs will not accept an email using just @localhost as domain. So, edit /etc/hosts file to make the domain localhost.com point to your machine, including this content to the file:

127.0.0.1 localhost.com

2 - Install Postfix

@adisetiawan
adisetiawan / README-Template.md
Created September 6, 2018 01:52 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@adisetiawan
adisetiawan / stream.js
Created February 20, 2018 14:42 — forked from DingGGu/stream.js
NodeJS Mp3 Streaming ExpressJS
var express = require('express');
var app = express();
var fs = require('fs');
app.listen(3000, function() {
console.log("[NodeJS] Application Listening on Port 3000");
});
app.get('/api/play/:key', function(req, res) {
var key = req.params.key;
@adisetiawan
adisetiawan / letitsnow.js
Created December 21, 2017 00:01 — forked from irony/letitsnow.js
God Jul Kodapor!
const outside = {weather: FRIGHTFUL}
const inside = {fire: DELIGHTFUL}
const go = places => places.some(p=>p>outside.weather)))
const snow = () => (outside.weather < inside.fire && !go(places)) {
let it = snow()
}
let it = snow()
@adisetiawan
adisetiawan / index.js
Created May 25, 2017 01:05 — forked from schnerd/index.js
index.js
const CDP = require('chrome-remote-interface');
const argv = require('minimist')(process.argv.slice(2));
const file = require('fs');
// CLI Args
const url = argv.url || 'https://www.google.com';
const format = argv.format === 'jpeg' ? 'jpeg' : 'png';
const viewportWidth = argv.viewportWidth || 1440;
const viewportHeight = argv.viewportHeight || 900;
const delay = argv.delay || 0;
@adisetiawan
adisetiawan / default
Created January 18, 2017 13:20 — forked from dtomasi/default
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}