Skip to content

Instantly share code, notes, and snippets.

View waviaei's full-sized avatar
🤔

Toru Miki waviaei

🤔
View GitHub Profile
@janogarcia
janogarcia / php_logical_operators.php
Created December 12, 2012 15:32
PHP Logical operators: The difference between OR vs ||, AND vs && explained. Key concepts: Logical operators precendence. Logical operators short-circuit evalutation.
<?php
// PHP Logical operators: The difference between OR vs ||, AND vs &&
// Key concept #1: "||" and "&&" have greater precedence than "=", "OR", "AND"
// http://php.net/manual/en/language.operators.precedence.php
// Key concept #2: PHP logical operators are short-circuit
// http://en.wikipedia.org/wiki/Short-circuit_evaluation
// http://php.net/manual/en/language.operators.logical.php
@gaspanik
gaspanik / hayaku-ja.mdown
Last active October 13, 2015 03:57
ST2: Hayaku ja

Hayakuの使い方

CSSを「速く」書くためのSublime Text 2のパッケージ「Hayaku!」について。

インストール

Package Controlからどうぞ

使い方

@gaspanik
gaspanik / ST2: User-Preferences.sublime-settings
Created November 17, 2012 03:03
ST2: User-Preferences.Sample
{
"bold_folder_labels": true,
// サイドバーのフォルダ名を太字に
"caret_style": "phase",
// キャレットのスタイルを変える。他に「smooth」「blick」「solid」「wide」など
"disable_formatted_linebreak": true,
// Emmetを有効にすると、日本語変換確定後に文字が消えるのを防ぐ
"disabled_single_snippet_for_scopes": "",
// Emmetを有効にすると、HTMLで「php」の展開が「<?php ?>」にならない問題の回避
"draw_minimap_border": true,
@nhoizey
nhoizey / screenshots.js
Created November 12, 2012 17:07
Take screenshots at different viewport sizes using CasperJS
/*
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes.
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed
*
* Usage:
* $ casperjs screenshots.js http://example.com
*/
var casper = require("casper").create();
@gaspanik
gaspanik / st2pkgs-for-webdev.markdown
Last active June 27, 2025 19:42
ST2: Sublime Text 2 Packages for Web Developers.

Recommended Sublime Text 2 Packages for Web Developers.

Update

  • 「Browser Support」を追加しました。

2013 Spring & Summer

こもりが使っているモノやそうでないものも含め、なんとなくWebデザイナーやWebデベロッパーな人たちに便利そうなのを集めてみました。

@gaspanik
gaspanik / Fetch.sublime-settings
Last active November 3, 2015 19:24
ST: Fetch files & packages
{
"files":
{
"Chart.js": "https://github.com/nnnick/Chart.js",
"Modernizr.js": "http://modernizr.com/downloads/modernizr-latest.js",
"Normalize.css 1.x": "https://github.com/necolas/normalize.css/blob/v1.1.3/normalize.css",
"Normalize.css 2.x": "https://github.com/necolas/normalize.css/blob/v2.1.3/normalize.css",
"Normalize.css 3.x": "https://raw.githubusercontent.com/necolas/normalize.css/master/normalize.css",
"Respond.js": "https://github.com/scottjehl/Respond/blob/master/dest/respond.min.js",
"Sanitize.css": "https://raw.github.com/ZDroid/sanitize.css/master/sanitize.css",
@wokamoto
wokamoto / replace-siteurl.php
Created September 4, 2012 23:22
WordPress のDB上のサイトURLを一気に変換
#!/usr/bin/php
<?php
switch($argc) {
case 1:
case 2:
echo "please input new site url and wp directory name!\n";
exit();
default:
$old_site = isset($argv[3]) ? $argv[3] : '';
$path = $argv[2];
@miya0001
miya0001 / gist:2864806
Created June 3, 2012 19:54
リバースプロキシやCDN,キャッシュ系のプラグインと仲良しで子テーマにも対応しやすいCSSの読み込み方
<link rel="stylesheet" type="text/css" media="all" href="<?php echo get_template_directory_uri(); ?>/style.css?ver=<?php echo filemtime(get_template_directory().'/style.css'); ?>" />
<?php if (is_child_theme()): ?>
<link rel="stylesheet" type="text/css" media="all" href="<?php echo get_stylesheet_directory_uri(); ?>/style.css?ver=<?php echo filemtime(get_stylesheet_directory().'/style.css') ?>" />
<?php endif; ?>
@markjaquith
markjaquith / gist:2653957
Created May 10, 2012 15:36
WordPress Fragment Caching convenience wrapper
<?php
/*
Usage:
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL
if ( !$frag->output() ) { // NOTE, testing for a return of false
functions_that_do_stuff_live();
these_should_echo();
// IMPORTANT
$frag->store();
// YOU CANNOT FORGET THIS. If you do, the site will break.
@Rarst
Rarst / r-debug.php
Last active June 12, 2025 01:56
R Debug (set of dump helpers for debug)
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: https://www.rarst.net/
License: MIT
*/