Skip to content

Instantly share code, notes, and snippets.

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

Dz darmawan01

🏠
Working from home
  • Indonesia
View GitHub Profile
@darmawan01
darmawan01 / 0_python_email.md
Created January 3, 2018 06:18 — forked from nickoala/0_python_email.md
Use Python to send and receive emails

Use Python to:

  • send a plain text email
  • send an email with attachment
  • receive and filter emails according to some criteria
@darmawan01
darmawan01 / php.ini
Created February 6, 2018 03:52 — forked from ardianta/php.ini
Konfigurasi server PHP saya di Xubuntu 15.10
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@darmawan01
darmawan01 / docker-help.md
Created December 31, 2018 13:05 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@darmawan01
darmawan01 / DateExtension.kt
Created March 2, 2019 01:58 — forked from maiconhellmann/DateExtension.kt
Date extensions wrote in Kotlin
import java.text.SimpleDateFormat
import java.util.*
/**
* Pattern: yyyy-MM-dd HH:mm:ss
*/
fun Date.formatToServerDateTimeDefaults(): String{
val sdf= SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())
return sdf.format(this)
@darmawan01
darmawan01 / nginx.conf
Created September 5, 2019 16:19
Static web ngixn conf
server {
listen 80 default_server;
server_name pasti.id;
root /usr/share/nginx/html;
index index.html;
location ~ ^/(css|js)/ {
expires max;
@darmawan01
darmawan01 / dokcer-compose.yml
Created September 5, 2019 16:20
Simple docker compose for static web
version "3"
sites:
image: nginx:1.15.8-alpine
restart: always
working_dir: /usr/share/nginx/html
ports:
- "2000:80"
volumes:
- ./proxy.conf:/etc/nginx/conf.d/default.conf
@darmawan01
darmawan01 / README.md
Last active July 27, 2021 05:12
Mostly Used Command

Docker

Copy some file to docker container

docker cp <file_to_copy> <container_name>:<dir_destination_in_docker>

PostgreSQl

Restore pg sql dump to docker container

docker container exec <container_db> psql -U <db_user> <db_name> -f <backup>.sql

@darmawan01
darmawan01 / my-vscode.settings.json
Last active November 12, 2020 08:19
Vscode - my custom vscode settings
{
"workbench.startupEditor": "none",
"window.zoomLevel": -2,
"editor.multiCursorModifier": "ctrlCmd",
"javascript.updateImportsOnFileMove.enabled": "always",
"terminal.integrated.rendererType": "dom",
"editor.minimap.enabled": false,
"workbench.panel.defaultLocation": "right",
"workbench.editor.tabCloseButton": "right",
"terminal.integrated.cursorStyle": "underline",
@darmawan01
darmawan01 / challenge-6.js
Last active October 28, 2019 03:43
#jumathek6
class Brankas {
unlock(key) {
const keys = key.split('')
let turned = 0,
lastPosition = 0,
isForward = true;
for (let i in keys) {
// Key less than last position and is forward, turnaround backward
// Or key greater than last position and is turnaround before, turned again forward
@darmawan01
darmawan01 / challenge-7.js
Last active October 28, 2019 03:43
#jumathek7
class Clock {
currentPosition(code) {
// Split the code to array of char
const codes = code.split('')
// Initiate some variables
let isMove = false,
position = 60,
currentCode = '';