As configured in my dotfiles.
start new:
tmux
start new with session name:
;;; init.el | |
;(setq debug-on-error t) | |
;; =============================================================================== | |
;; | |
;; Environmental discrimination(環境識別) | |
;; | |
;; =============================================================================== | |
(defvar *run-unix-like-p* | |
(or (equal system-type 'gnu/linux) |
function is_blog () { | |
global $post; | |
$posttype = get_post_type($post ); | |
return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ) ? true : false ; | |
} | |
Usage: | |
<?php if (is_blog()) { echo 'You are on a blog page'; } ?> |
some |
<?php | |
interface ExampleInterface{ | |
function getHoge(); | |
function getFuga(); | |
function setAge(int $age); | |
} | |
class Example implements ExampleInterface{ | |
function getHoge(){ | |
} |
As configured in my dotfiles.
start new:
tmux
start new with session name:
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
// XHR | |
var ajax = function (method, url, data, callback) { | |
var xhr = /*@cc_on!@*/true ? new XMLHttpRequest() : new XDomainRequest(); | |
xhr.timeout = 3000; | |
xhr.ontimeout = function () { | |
alert("timeout"); | |
}; | |
xhr.onerror = function () { | |
alert("error"); | |
}; |
class File | |
def self.append(path, text) | |
File.open( path, "a" ) do |output| | |
output.puts text | |
end | |
end | |
end | |
if $0 == __FILE__ then |