Skip to content

Instantly share code, notes, and snippets.

<?php
/*
Dalam Bab I yang berisi ketentuan umum,
pada angka 15 disebutkan,
"Parkir adalah keadaan Kendaraan berhenti atau tidak bergerak untuk beberapa saat dan ditinggalkan pengemudinya."
Adapun pada angka 16 disebutkan,
"Berhenti adalah keadaan Kendaraan tidak bergerak untuk sementara dan tidak ditinggalkan pengemudinya."
*/
@wurin7i
wurin7i / alternamed.sh
Last active July 15, 2022 10:00
Buat masukin dan menghapus daftar domain yg diblokir trust positif.
#!/bin/bash
# CARA INSTALL
# salin source dan simpan dalam berkas alternamed.sh
# pindahkan alternamed.sh ke /usr/local/bin/alternamed.sh
# beri akses executable: sudo chmod a+x /usr/local/bin/alternamed.sh
# Author: Wuri Nugrahadi <w.nugrahadi@gmail.com>
[[ $# -lt 3 ]] &&
echo -e "Penggunaan: $(basename $0) block|release filename named.conf comment\nContoh:" &&
#!/bin/bash
# dbbackup.sh
# Descr: Dump MySQL database data into separate compressed SQL files.
# Usage: Run without args for usage info.
# Author: @Wuri Nugrahadi
# Ref: http://unix.stackexchange.com/questions/123189/cronjob-for-automatic-db-backup-to-date-prefixed-file
# Ref: http://stackoverflow.com/q/3669121/138325
# Notes:
# * Output files are compressed and saved in the current working dir, unless
#! /usr/bin/python
from sys import argv
from os.path import exists
from os import makedirs
from os import symlink
from os import system
import getopt
#
@wurin7i
wurin7i / printer-media-query.html
Last active January 1, 2016 04:39
Contoh css media query
<html>
<head>
<style>
.panel {
border: 1px solid #000;
padding: 10px;
margin: 10px;
}
@media print {
.screen {
@wurin7i
wurin7i / damm_check_digit.php
Last active March 1, 2020 15:44
Damm validation & generation code in PHP.Damm algorithm is a check digit algorithm that detects all single-digit errors and all adjacent transposition errors.
<?php
/**
* The Damm check digit
* For more information cf. http://en.wikipedia.org/wiki/Damm_algorithm
* totally anti-symmetric quasigroup
*
* @author Wuri Nugrahadi <w.nugrahadi@gmail.com>
*/
if (! function_exists('taq'))
{
function AttachmentCtrl($scope, $location, $timeout, Docs) {
$(function() {
$('#detail-form-doc').fileupload({
dataType: 'json',
url: '/angular-ib/app/fileupload?id=' + $location.search().id,
add: function(e, data) {
$scope.$apply(function(scope) {
// Turn the FileList object into an Array
for (var i = 0; i < data.files.length; i++) {
$scope.project.files.push(data.files[i]);
@wurin7i
wurin7i / remove duplicate word
Created April 12, 2013 07:44
Menghilangkan duplikat kata. Implentasi untuk slug efisien
$str = 'laki-laki harus berani';
$str = preg_replace('~([^\s\-]+)[\s\-]\1~', '\1', $str);
echo $str;