Skip to content

Instantly share code, notes, and snippets.

View ww24's full-sized avatar
🏢
≡GO

Takenori Nakagawa ww24

🏢
≡GO
View GitHub Profile
@noqisofon
noqisofon / init.el
Created December 21, 2010 00:10
現在の init.el。
;;; init.el
;(setq debug-on-error t)
;; ===============================================================================
;;
;; Environmental discrimination(環境識別)
;;
;; ===============================================================================
(defvar *run-unix-like-p*
(or (equal system-type 'gnu/linux)
@wesbos
wesbos / is_blog.php
Created September 2, 2011 19:32
WordPress is_blog()
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'; } ?>
@KOBA789
KOBA789 / a.txt
Created November 25, 2011 13:29
async-without-indent
some
@miio
miio / example.php
Created December 31, 2011 17:11
PHPでクラスとインタフェース 型指定の関係
<?php
interface ExampleInterface{
function getHoge();
function getFuga();
function setAge(int $age);
}
class Example implements ExampleInterface{
function getHoge(){
}

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
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"
@repeatedly
repeatedly / d_master.md
Last active June 8, 2023 06:20
D言語基礎文法最速マスター

他の言語をある程度知っている人はこれを読めばD言語の基礎をマスターでき,D言語の氷山の一角くらいは知ることができると思います.対象バージョンはdmd 2.059です.

1. 基礎

ソースファイル

ASCIIかUTFしか受け付けません.それ以外の文字コードで書くとコンパイルエラーになります.

main

D言語のmainはCとは違い以下のようなシグネチャです.

@ww24
ww24 / xhr.js
Created June 17, 2012 02:41
Cross Browser XHR
// 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");
};
@y-yu
y-yu / inherit.md
Created August 9, 2012 06:57
JavaScriptの継承について

JavaScriptの継承について

全然理解出来てなかったので調べてみた。

経緯

function f () {
	// Class
}
@noqisofon
noqisofon / File.append.rb
Created September 15, 2012 07:22
File クラスに append っていうクラスメソッドを追加した感じ。
class File
def self.append(path, text)
File.open( path, "a" ) do |output|
output.puts text
end
end
end
if $0 == __FILE__ then