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
@k16shikano
k16shikano / SKILL.md
Last active August 17, 2026 03:19
cognitive-rhythm-writing/SKILL.md
name cognitive-rhythm-writing
description 説明的な文章に緩急を設計するための規範。緩急を装飾ではなく認知モードの切替(観察→逡巡→断定→再観察)と未回収の緊張の管理として扱い、文の拍、段落の密度波形、節の入り方、緩みと駄文の判別、執筆後の機械的な点検手順を定める。読み物として読ませたい章・記事・解説文を生成するとき、または「密度はあるが平坦でおもしろくない」文章を診断・修正するときに使用する。

認知リズムを生むための日本語ライティング規範

密度の高い文章が退屈になるのは、情報が多いからではなく、全文が同じ認知モードで書かれているからである。 この規範は、読者の認知モード(観察する、迷う、確信する、確かめ直す)を意図的に切り替え、常に「続きを読む理由」を維持することで、読み進める推進力を作る。

@kodie
kodie / wp_custom_orderby.php
Last active November 24, 2020 06:49
Create a custom query 'orderby' type that uses data from other tables in WordPress
<?php
// Fetch data required for custom orderby types and left join it into the query
add_filter('posts_join_paged', 'custom_orderby_joiner', 10, 2);
function custom_orderby_joiner($join_paged_statement, $wp_query) {
$orderby = $wp_query->query_vars['orderby'];
if ($orderby === 'popularity') {
$join_paged_statement .= " INNER JOIN (SELECT postid, pageviews FROM wp_popularpostsdata) popularpostsdata ON popularpostsdata.postid = wp_posts.ID";
}
@kenmori
kenmori / JavaScript.md
Last active April 2, 2026 04:08
JavaScript練習問題集(ECMAScript2015,2016,2017,2018,2019,2020, 2021, 2022, 2023, 2024, 2025, other Library)

JavaScript練習問題集

JavaScript

更新情報

・constをletに修正、問題を追加(2024/9/27)
・問題を追加(2024/7/20)
・問題を追加(2024/4/12)
@bdsexton
bdsexton / csv-trees.md
Last active July 25, 2022 03:50
Generate File System Trees in CSV Format with "tree" and "sed"

Generate File System Trees in CSV Format with "tree" and "sed"

Description

I don't know whether this will be useful to anyone else, but I wanted to use the Linux tree command to generate file system trees in CSV format on OS X. This should work pretty much as is on Linux, although you may need or want to change the paths and optimize the usage of sed.

Dependency

This uses the Linux "tree" command, which is not standard on OS X.

@fabrizim
fabrizim / acf-customizer-patch.php
Last active May 31, 2025 20:56
Plugin to allow for Advanced Custom Fields to be used in widgets within the Customizer
<?php
/*
Plugin Name: ACF Customizer Patch
Plugin URI: https://gist.github.com/fabrizim/9c0f36365f20705f7f73
Description: A class to allow acf widget fields to be stored with normal widget settings and allow for use in customizer.
Author: Mark Fabrizio
Version: 1.0
Author URI: http://owlwatch.com/
*/
class acf_customizer_patch
@a-axton
a-axton / build.scss
Created June 30, 2014 01:51
Bootstrap style grid using neat and SASS maps
// replace map keys with whatever you want
// creats classes as .grid-$keyname-$col
$breakpoint-widths: (xs: 480px, sm: 768px, md: 992px, lg: 1200px);
$grid-columns: 12
// media query mixin
@mixin mq($search) {
@media (min-width: map-get($breakpoint-widths, $search)){
@content
}
@scottzirkel
scottzirkel / install-wp.sh
Created June 27, 2014 20:26
Custom WordPress install script
#!/bin/bash
echo "What is the theme name? (no spaces)"
read THEME
echo Installing Wordpress
git clone git@github.com:scottzirkel/wordpress-base.git website ## This pulls down my WordPress starter template
cd website
echo Installing Composer ## I use Composer to manage the backend dependencies (ie: WordPress, public plugins, etc)
composer install
cd app/themes
echo Setting up "$THEME"
@mala
mala / gist:9086206
Created February 19, 2014 04:49
CSRF対策用トークンの値にセッションIDそのものを使ってもいい時代なんて、そもそも無かった

概要

http://co3k.org/blog/csrf-token-should-not-be-session-id について。

この記事では触れられていませんが、

  • むかし、セッションIDをHTMLソース中に埋め込んでも脅威は変わらないと主張した人がいました
  • 正確には「hiddenの値のみ漏れやすいような特殊な脆弱性が無ければ」という前提であったけれど、実際にそのようなバグはあったし、予見されていた。
  • とても影響のある人だったので、色々なサイトや書籍がその方法を紹介し、安全なウェブサイトの作り方にも載ってしまいました

この際ハッキリ言っておくべきだと思うので書きますが、そもそもセッションIDを(HTMLソース中に埋め込む)CSRF対策トークンとして使うのは間違いでした。最初から間違っていたのです。正確に言うとCSRFの話は関係ないですね。CSRF関係なく、特に「単体で」セッションハイジャックが可能になるような値を、HTMLソース中に埋め込むべきではありません。

@claudiosanches
claudiosanches / functions.php
Last active January 2, 2016 13:09
WordPress - Gulp
<?php
/**
* Load site scripts.
*
* @since 1.0.0
*
* @return void
*/
function wpgulp_enqueue_scripts() {
@bomberstudios
bomberstudios / sketch-plugins.md
Last active January 2, 2026 16:22
A list of Sketch plugins hosted at GitHub, in no particular order.