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 / 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 = '';
@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
package main
import (
"fmt"
"strings"
)
func main() {
// Our Test
args := "1 1 0 0 2 1"
@darmawan01
darmawan01 / fresh.bat
Last active February 6, 2020 09:08
Issues: MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error
Solved:
1. Login to redis client
2. Execute config set stop-writes-on-bgsave-error no
3. Execute FLUSHALL (Delete all keys from all Redis databases)
4. Execute config set stop-writes-on-bgsave-error yes
@darmawan01
darmawan01 / date.js
Created April 29, 2020 02:35
Formating datetime
export const getDateFromTimeStamp = (timestamp) => {
return date.format(new Date(timestamp), 'ddd, DD MMMM YYYY', { locale: dateLocaleId })
}