Skip to content

Instantly share code, notes, and snippets.

View 1shiharat's full-sized avatar
💭
I may be slow to respond.

ishihara takashi 1shiharat

💭
I may be slow to respond.
View GitHub Profile
@nojimage
nojimage / eccube-permission.sh
Last active September 4, 2015 12:14
EC-CUBEのインストール時パーミッション設定用スクリプト
#!/bin/sh
## EC CUBE set permission
chmod -R o+w html/install/temp/
chmod -R o+w html/user_data/
chmod -R o+w html/upload/
chmod -R o+w data/class/
chmod -R o+w data/cache/
chmod -R o+w data/logs/
chmod -R o+w data/downloads/
chmod -R o+w data/upload/
@jnrbsn
jnrbsn / better-gist-styles.css
Created September 14, 2010 01:24
Better styles for embedding GitHub Gists
/* Better styles for embedding GitHub Gists */
.gist{font-size:13px;line-height:18px;margin-bottom:20px;width:100%}
.gist pre{font-family:Menlo,Monaco,'Bitstream Vera Sans Mono','Courier New',monospace !important}
.gist-meta{font-family:Helvetica,Arial,sans-serif;font-size:13px !important}
.gist-meta a{color:#26a !important;text-decoration:none}
.gist-meta a:hover{color:#0e4071 !important}
@adaburrows
adaburrows / compose_functions.php
Created April 26, 2011 06:24
Composing functions in PHP
<?php
/**
* Just trying out more functional programming in PHP
* This gist provides some basic utility functions for:
* + Working with functions
* + Working with arrays
*/
// This function allows creating a new function from two functions passed into it
function compose(&$f, &$g) {
@jonleighton
jonleighton / base64ArrayBuffer.js
Last active May 21, 2024 04:57
Encode an ArrayBuffer as a base64 string
// Converts an ArrayBuffer directly to base64, without any intermediate 'convert to string then
// use window.btoa' step. According to my tests, this appears to be a faster approach:
// http://jsperf.com/encoding-xhr-image-data/5
/*
MIT LICENSE
Copyright 2011 Jon Leighton
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@mgsisk
mgsisk / html.regex
Last active January 13, 2022 21:49
[HTML Regex] Regular expression pattern for matching HTML tags.
<(?(?=!--)!--[\s\S]*--|(?(?=\?)\?[\s\S]*\?|(?(?=\/)\/[^.\d-][^\/\]'"[!#$%&()*+,;<=>?@^`{|}~ ]*|[^.\d-][^\/\]'"[!#$%&()*+,;<=>?@^`{|}~ ]*(?:\s[^.\d-][^\/\]'"[!#$%&()*+,;<=>?@^`{|}~ ]*(?:=(?:"[^"]*"|'[^']*'|[^'"<\s]*))?)*)\s?\/?))>
< # Tags always begin with <.
(? # What if...
(?=!--) # We have a comment?
!--[\s\S]*-- # If so, anything goes between <!-- and -->.
| # OR
(? # What if...
(?=\?) # We have a scripting tag?
\?[\s\S]*\? # If so, anything goes between <? and ?>.
@tily
tily / scaling_isomorphic_javascript_code.ja.markdown
Last active May 1, 2023 09:03
サバクラ両方で動く JavaScript の大規模開発を行うために

サバクラ両方で動く JavaScript の大規模開発を行うために

原文:Scaling Isomorphic Javascript Code (This is just for study, please contact me at tily05 atmark gmail.com if any problem.)

考えてみれば Model-View-Controller とか MVC ってよく聞くよね。実際どんなものか知ってる? 抽象的に言うなら「オブジェクト情報の保持されるグラフィック・システム (つまり、ラスターではないグラフィック。ゲームとか) 上に構築された、表示系を中心としたアプリケーションにおいて、主要な機能どうしの関わりをうまく分離すること」とでも言おうか。もう少し深く考えを押し進めてみれば、これは当然、他のさまざまなアプリケーションにもあてはまる言葉 (bucket term ?) だ。

過去に多くの開発コミュニティが MVC による解決案を提供し、それによってよくあるユースケースにうまく対処し、地位を築くことができた。例をあげるなら、Ruby や Python コミュニティは Rails や Django を作り、MVC アーキテクチャを実現した。

@nazgob
nazgob / ctags.setup
Created January 6, 2012 13:44
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
@ogorzalka
ogorzalka / orderby_tax_clauses.inc.php
Created March 29, 2012 08:59
Sorting by Taxonomy in WordPress
/*
Sorting by Taxonomy in WordPress
just add this file in your functions.php file
*/
function orderby_tax_clauses( $clauses, $wp_query ) {
global $wpdb;
$taxonomies = get_taxonomies();
foreach ($taxonomies as $taxonomy) {
if ( isset( $wp_query->query['orderby'] ) && $taxonomy == $wp_query->query['orderby'] ) {
@mikeschinkel
mikeschinkel / advanced-cache.php
Created July 24, 2012 05:36
Page Cache dropin for WordPress - PROOF OF CONCEPT ONLY
<?php
/**
* Page Cache dropin for WordPress
*
* Designed to be written to /wp-content/advanced-cache.php
*
* This is a proof-of-concept; it is NOT READY FOR PRODUCTION USE.
*
* Author: Mike Schinkel (mikeschinkel@gmail.com)
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik