Skip to content

Instantly share code, notes, and snippets.

View dedenf's full-sized avatar

Deden Fathurahman dedenf

View GitHub Profile
$xml->{“a-tag”}
function directory_map($source_dir, $directory_depth = 0, $hidden = FALSE)
{
if ($fp = @opendir($source_dir))
{
$filedata = array();
$new_depth = $directory_depth - 1;
$source_dir = rtrim($source_dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
while (FALSE !== ($file = readdir($fp)))
{
@dedenf
dedenf / dhcp.conf
Created July 16, 2012 07:59
vmware dhcp.conf
host virtual-ubuntu2 {
hardware ethernet 00:50:56:3a:87:00;
fixed-address 172.16.47.11;
}
Fetching: i18n-0.6.1.gem (100%)
Fetching: multi_json-1.5.0.gem (100%)
Fetching: activesupport-3.2.11.gem (100%)
Fetching: json-1.5.4.gem (100%)
Building native extensions.  This could take a while…
Fetching: hashie-1.2.0.gem (100%)
Fetching: chozo-0.4.2.gem (100%)
Fetching: addressable-2.3.2.gem (100%)
Fetching: multipart-post-1.1.5.gem (100%)

Fetching: faraday-0.8.4.gem (100%)

/* H5BP image replacement: http://nicolasgallagher.com/another-css-image-replacement-technique/ */
.ir {
border: 0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@dedenf
dedenf / lastfm
Last active January 16, 2017 04:48
php script to fetch your last listened track on lastfm, an you can add this to your hooks or commit message $(lasfm)
#!/usr/bin/php
<?php
$url = "http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=USERNAME&api_key=YOU_API_KEY&format=json&limit=1";
// Initializing curl
$ch = curl_init($url);
$options = array(
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_HTTPHEADER => array('Content-type: application/json')
#!/bin/bash
echo "Enter a domain (e.g. example.com):";
read domain;
echo ""
echo "Enter a virtual host name (e.g. dev, as in dev.example.com
Just enter only the virtual host name)"
read vhname
echo ""
MariaDB [dprms1]> show engine innodb status\G
*************************** 1. row ***************************
Type: InnoDB
Name:
Status:
=====================================
140110 7:06:10 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 14 seconds
-----------------
server {
listen 80;
server_name api.erafone.com;
root /home/www-data/srv/api/public;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ @rewrites;
autoindex on;
tomorrow is your big day, i'm happy for you, genuinely very much.
you are one of the few person that i look upon,
you are one person that i'll take the risk if it's rewarding
you taught me a lot of things, remember you taught me regex in my small room?
altough i still cant master it...., but i do remember all of it.
you always wanna push me into my limit, and i did.