Instantly share code, notes, and snippets.

View bookmarklet
javascript:(function(){$(".container.bg-timetable").css("max-width","90%");$(".fc-scroller.fc-time-grid-container").css("height","initial");$("#calendar").css("width","initial")})();
View coding-style-guid.md

コーディングスタイルガイド

一般

インデント

EditorConfigで揃える

改行コード

View SimpleDelegate.php
<?php
class SimpleDelegate {
protected $callbacks = [];
public function add(Closure $callback, $key = null){
$key = $key?: spl_object_hash($callback);
$this->callbacks[$key] = $callback;
}
View callee.sh
#!/bin/sh
echo " #${0} begin"
echo " echo \$WORKING_DIR"
echo " ${WORKING_DIR}"
echo " #${0} end"
View test.sh
#!/bin/sh
echo "\$ echo \$(pwd)"
echo $(pwd) #Current directory not changed.
echo "\$ \$(cd ..)"
$(cd ..)
echo "\$ echo \$(pwd)"
echo $(pwd) #Current directory not changed.
View Publisher.cs
using UnityEditor;
using UnityEditorInternal;
namespace Kanonji.TagManagerEvent
{
public delegate void OnTagsChangedHandler(string[] tags);
public class Publisher
{
public static event OnTagsChangedHandler OnTagsChanged;
View ConstMapTrait.php
<?php
trait ConstMapTrait{
private static $const_map = [];
public static function const_map($prefix = 0){
if(! isset(self::$const_map[$prefix])){
if(0 === $prefix){
self::$const_map[$prefix] = (new \ReflectionClass(get_called_class()))->getConstants();
} else {
self::const_map();
$list = self::$const_map[0];
View relative_path_helper.js
var tag_helpers = {
relative_path: function(basePath) { // I want basePath in this scope.
var pathDepth = basePath.split('/').length -2;
var path = new Array(pathDepth + 1).join('../');
return path;
}
};
module.exports = {
get: function(basePath, file_extension, options, callback){