This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// lib php couchdb | |
require 'lib/couch.php'; | |
require 'lib/couchClient.php'; | |
require 'lib/couchDocument.php'; | |
// config couchdb | |
define('COUCH_DSN', 'http://127.0.0.1:5984'); | |
define('COUCH_DBNAME', 'testcase_blog'); | |
// config memcache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_id": "_design/get_blog_posts", | |
"language": "javascript", | |
"views": { | |
"all": { | |
"map": "function(doc) { emit(doc._id, doc); } " | |
}, | |
"by_date": { | |
"map": "function(doc) { if (doc) { emit(doc.created_at, null); } }" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//check duplicate entry | |
$arr = [1,2,3,3,3,4,4,5,6,7,8,9,10,10,10,10,10,20,20]; | |
// solution 1 | |
function has_duplicate1($array) { | |
$dupl = []; | |
$space = php_sapi_name() == 'cli' ? "\n" : "<br>"; | |
foreach(array_count_values($array) as $value => $count) { | |
if ($count > 1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ini adalah cara untuk memblockir iklan speedy jika kita salah ketik url website, | |
lalu telkom akan mengarahkan ke situs http://v3.mercusuar.uzone.id/?url=kamusalahketikurl.com | |
# Windows User | |
===================== | |
1. Edit file hosts C:\Windows\System32\Drivers\etc\hosts menggunakan notepad | |
2. Tambahkan seperti berikut: | |
127.0.0.1 v3.mercusuar.uzone.id # block telkom redirect | |
127.0.0.1 118.97.116.10 | |
127.0.0.1 mercusuar.uzone.id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// format xml | |
/* | |
<products> | |
<product> | |
.... | |
.... | |
<product> | |
</products> | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ModPagespeedDomain http://local.dev.com | |
ModPagespeedDisallow */admin/* | |
ModPagespeedMapOriginDomain http://localhost http://local.dev.com | |
ModPagespeedStatistics on | |
ModPagespeedStatisticsLogging on | |
ModPagespeedEnableFilters prioritize_critical_css | |
ModPagespeedEnableFilters rewrite_images | |
ModPagespeedEnableFilters recompress_png | |
ModPagespeedEnableFilters convert_png_to_jpeg,convert_jpeg_to_webp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vim ~/.vimrc | |
set number | |
set tabstop=4 | |
set shiftwidth=4 | |
set softtabstop=4 | |
set expandtab |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo swapoff -a | |
$ sudo swapon -a | |
$ sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=2048 | |
$ sudo /sbin/mkswap /var/swap.1 | |
$ sudo /sbin/swapon /var/swap.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
..... | |
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so | |
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so | |
ProxyRequests off | |
ProxyPass /feed/ http://abcdefg.cloudfront.net/feed/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend default { | |
.host = "local.app.com"; | |
.port = "8080"; | |
} | |
sub vcl_recv { | |
if (req.request == "GET" && req.url ~ "\.(gif|jpg|jpeg|png|ico)$") { | |
return(lookup); | |
} | |
else { |