This file contains 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
curl -X GET "http://localhost:9200/licence-finder/_search?pretty=true" -d '{"query":{"query_string":{"query":"title.autocomplete:organ*"}},"sort":[{"title.sortable":"asc"}]}' | |
{ | |
"took" : 72, | |
"timed_out" : false, | |
"_shards" : { | |
"total" : 5, | |
"successful" : 5, | |
"failed" : 0 | |
}, | |
"hits" : { |
This file contains 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
# First, create the synonyms file /opt/elasticsearch/name_synonyms.txt | |
# with the contents: | |
# | |
# rob,bob => robert | |
# | |
## CREATE THE INDEX WITH ANALYZERS AND MAPPINGS | |
curl -XPUT 'http://127.0.0.1:9200/test/?pretty=1' -d ' | |
{ |
This file contains 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
// http://stackoverflow.com/questions/1114024/constructors-in-javascript-objects | |
var MyClass = (function () { | |
// private static | |
var nextId = 1; | |
// constructor | |
var cls = function () { | |
// private | |
var id = nextId++; | |
var name = 'Unknown'; |
This file contains 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 | |
/** | |
* @author Anggiajuang Patria <anggiaj@gmail.com> | |
* 3/20/13/2:32 PM | |
*/ | |
/** | |
* Class CopyAttributesBehavior | |
* kelas sederhana untuk meng-kopi (value) antara model satu dengan lainnya |
This file contains 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
# Bunuh banyak proses sekaligus | |
kill $(ps aux | grep '[/]bin/bash /home/mcmforex/shell/mq.sh' | awk '{print $2}') | |
# Cari file besar | |
ls -lSh . | head -5 |
This file contains 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
#!/bin/bash | |
# Pull this file down, make it executable and run it with sudo | |
# wget https://raw.github.com/gist/6152521/build-erlang-r16b01.sh | |
# chmod u+x build-erlang-r16b01.sh | |
# sudo ./build-erlang-r16b01.sh | |
if [ $(id -u) != "0" ]; then | |
echo "You must be the superuser to run this script" >&2 | |
exit 1 | |
fi |
This file contains 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 | |
class Cards | |
{ | |
private $cards; | |
private $card; | |
public function __construct(Card $card = null) | |
{ | |
$this->card = $card; | |
} |
This file contains 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 | |
include __DIR__ . '/Cards.php'; | |
/** | |
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2013-08-31 at 19:17:43. | |
*/ | |
class CardsTest extends PHPUnit_Framework_TestCase | |
{ | |
/** | |
* @var Cards |
This file contains 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
http://www.net-snmp.org/wiki/index.php/Git_Workflow | |
https://console.moovweb.com/learn/docs/cloud/workflow | |
http://newtriks.com/2011/12/01/automated-deployment-using-git/ |
This file contains 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
#!/usr/bin/env php | |
<?php | |
if (!isset($argv[1])) { | |
echo "Usage: createphpproject {project_name}\n\n"; | |
exit; | |
} | |
$projectName = trim($argv[1]); | |
$workingDir = str_replace('\\', '/', __DIR__); | |
$targetDir = (isset($argv[2]) ? trim($argv[2]) : $workingDir) . '/' . $projectName; |
OlderNewer