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/sh | |
cli=/Applications/Karabiner.app/Contents/Library/bin/karabiner | |
$cli set remap.fn_consumer_to_fkeys_f5 1 | |
/bin/echo -n . | |
$cli set general.dont_remap_apple_keyboard 1 | |
/bin/echo -n . | |
$cli set remap.fn_consumer_to_fkeys_f7 1 | |
/bin/echo -n . |
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 | |
# | |
# hook script for swiftlint. It will triggered when you make a commit. | |
# | |
# If you want to use, type commands in your console. | |
# $ ln -s ../../pre-commit-swiftlint.sh .git/hooks/pre-commit | |
# $ chmod +x .git/hooks/pre-commit | |
LINT=$(which swiftlint) |
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
class AggregateRoot { | |
apply(event) { | |
this.handle(event) | |
return this | |
} | |
handle(event) { | |
var eventName = event.constructor.name | |
var eventMethod = `apply${eventName}` |
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 | |
// Usually, you can get category tree from category helper | |
$helper = Mage::helper('catalog/category'); | |
$nodes = $helper->getStoreCategories(); | |
// return Varien_Data_Tree_Node_Collection | |
// via Mage_Catalog_Model_Resource_Category | |
// However, this get method return active category only. | |
// Most of the samples are for collection of the category. |
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 OldTrigger = $.fn.trigger; | |
$.fn.trigger = function () { | |
if (arguments[0] === 'dmp_AD_FETCHER_RESPONDED') { | |
jQuery('.np_SliderSeek').hide(); | |
return; | |
} | |
return OldTrigger.apply(this, arguments); | |
}; |
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
mkdir helloworld && cd helloworld | |
echo "# HelloWorld" > README.md | |
dotnet new sln -n HelloWorld | |
mkdir src test | |
dotnet new angular --output src/HelloWorld.WebApp --name HelloWorld.WebApp | |
dotnet new xunit --output test/HelloWorld.WebApp.Tests --name HelloWorld.WebApp.Tests | |
cd test/HelloWorld.WebApp.Tests |
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 | |
/* | |
Plugin Name: FeedWordPress Bulk Zap | |
Plugin URI: http://haruair.com | |
Description: Code snipet for bulk zap of FeedWordPress | |
Version: 0.1 | |
Author: Haruair | |
Author URI: http://haruair.com | |
License: GPL v2 | |
*/ |
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
function generatedId() { | |
return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c => | |
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16) | |
) | |
} | |
class LocalStorageEventStore { | |
getStorage() { | |
var raw = window.localStorage.getItem('event-store') | |
var data = JSON.parse(raw) || [] |
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 | |
interface FoodInterface | |
{ | |
} | |
class FriedChicken implements FoodInterface | |
{ | |
public function getName() | |
{ | |
return self::class; |
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 Wattle\DI; | |
use ReflectionClass; | |
use Exception; | |
use Closure; | |
/** | |
* Scope Implementation. | |
*/ |
NewerOlder