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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
var NRP = require("node-redis-pubsub"); | |
var config = { | |
host: "localhost", | |
port: 6379, // Port of your locally running Redis server | |
scope: "prerender" // Use a scope to prevent two NRPs from sharing messages | |
}; | |
var nrp = new NRP(config); // This is the NRP client | |
nrp.on("say hello", function(data) { |
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
<iframe onload={()=>{ | |
setTimeout(()=>{ | |
// console.log(.html()); | |
},1000); | |
$.when($('#framenya').contents().find('html')).then((dom)=>{ | |
var waitForEl = function(selector, callback) { | |
if (dom.find(selector).length) { | |
setTimeout(function() { | |
callback(); | |
}, 1000); |
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
return response()->stream(function () use ($writer) { | |
$writer->save('php://output'); | |
}, 200, [ | |
'Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', | |
'Content-Disposition' => 'attachment', | |
'filename' => 'file.xlsx', | |
]); |
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
public function to_array(&$object = '') | |
{ | |
// IF OBJECT, MAKE ARRAY | |
if (is_object($object)) {$object = (array) $object;} | |
// IF NOT ARRAY OR EMPTY ARRAY, RETURN = LEAVES SCALARS | |
if (!is_array($object) || empty($object)) {return;} | |
// FOR EACH ITEM, RECURSE VALUE | |
foreach ($object as &$Value) {$this->to_array($Value);} |
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
[2019-06-27 04:21:06] production.ERROR: read error on connection {"exception":"[object] (RedisException(code: 0): read error on connection at /home/akasa/artywiz/vendor/laravel/framework/src/Illuminate/Redis/Connections/PhpRedisConnection.php:348) | |
[stacktrace] | |
#0 /home/akasa/artywiz/vendor/laravel/framework/src/Illuminate/Redis/Connections/PhpRedisConnection.php(348): Redis->psubscribe(Array, Object(Closure)) | |
#1 /home/akasa/artywiz/vendor/laravel/framework/src/Illuminate/Redis/RedisManager.php(140): Illuminate\\Redis\\Connections\\PhpRedisConnection->psubscribe(Array, Object(Closure)) | |
#2 /home/akasa/artywiz/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(221): Illuminate\\Redis\\RedisManager->__call('psubscribe', Array) | |
#3 /home/akasa/artywiz/app/Console/Commands/RedisSubscribe.php(89): Illuminate\\Support\\Facades\\Facade::__callStatic('psubscribe', Array) | |
#4 [internal function]: App\\Console\\Commands\\RedisSubscribe->handle() | |
#5 /home/akasa/artywiz/vendor/laravel/framework/src/Illuminate |
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 namespace App\Traits; | |
use Illuminate\Database\Eloquent\Builder; | |
use Illuminate\Support\Facades\Config; | |
use Illuminate\Support\Facades\DB; | |
use Illuminate\Support\Str; | |
use Nicolaslopezj\Searchable\SearchableTrait as ParentSearchableTraits; | |
/** | |
* Trait SearchableTrait |
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
Jika pada saat create user namun tab autocomplete tidak jalan maka : | |
sudo chsh -s /bin/bash <username> | |
source : | |
https://askubuntu.com/questions/325807/arrow-keys-home-end-tab-complete-keys-not-working-in-shell |
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
client list -> Melihat driver yang melakukan koneksi | |
info -> melihat isi penggunnaan redis |
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
var Original = { | |
extend : function(props = null) { | |
var newOne = Object.assign({}, this); | |
newOne.super = Object.assign({}, newOne); | |
if (props != null) { | |
for(var key in props){ | |
if(props[key].toString().includes('.super') == false){ | |
if(key != 'construct'){ | |
console.log('key',key); | |
newOne.super[key] = props[key]; |
OlderNewer