Skip to content

Instantly share code, notes, and snippets.

View k4zuki02h4t4's full-sized avatar
🏠
家で働く

KAZUKI Otsuhata k4zuki02h4t4

🏠
家で働く
View GitHub Profile
@bamboo-c
bamboo-c / gulpfile.js
Last active August 29, 2015 14:07
gulpfile.js
"use strict";
// variables
var gulp = require("gulp");
var $ = require("gulp-load-plugins")();
var jade = require("gulp-jade");
var stylus = require("gulp-stylus");
var spritesmith = require("gulp.spritesmith");
var uglify = require("gulp-uglify");
var autoprefixer = require("gulp-autoprefixer");
@kurudrive
kurudrive / gist:09f37db0939d57df08c1
Last active January 16, 2023 06:25
[WordPress]よく使うエスケープ処理の書き方
/* 参照・参考
http://firegoby.jp/archives/2244
http://www.rescuework.jp/blog/customfield-escape.html
*/
// HTMLをエスケープ
esc_html($content);
// URLをエスケープ
esc_url($url);
@ipedrazas
ipedrazas / gist:6d6c31144636d586dcc3
Last active July 10, 2023 16:24
Nginx ssl config

The process starts by creating the CSR and the private key:

openssl req -nodes -newkey rsa:2048 -nodes -keyout dotmarks.net.key -out dotmarks.net.csr -subj "/C=GB/ST=London/L=London/O=dotmarks/OU=IT/CN=dotmarks.net"

Generates

  • dotmarks.net.key
  • dotmarks.net.csr
@haribote
haribote / Basic of JavaScript
Last active October 3, 2016 06:13
"Basic of JavaScript"は、株式会社まぼろし( http://maboroshi.biz/ )の新人・若手向けJavaScript入門資料です。
# 目次
+ JavaScript オブジェクトと値の型
@salcode
salcode / .gitignore
Last active February 10, 2024 10:56
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@fukata
fukata / gist:7956849
Created December 14, 2013 08:18
WordPress thumbnail use flickr
個人で使っているブログの画像は全てflickrにアップしたものを使ってるんだけど、WordPressのアイキャッチ画像にもflickrにアップしたものを使いたい。
ただし、前提条件としてサムネイルをWPをインストールしたサーバに配置しないこと。ざっとプラグインを探してみたところ、flickrからアイキャッチ画像にするものはあるけど、サムネイル画像はサーバ内に保存するものが多い。
また、アイキャッチ画像は記事内の最初に出てくる画像でよい。ということで、面倒なUIとか要らない。設定したら自動でやってくれるというのが運用上助かる。
WPでアイキャッチ画像のhtmlを出力する関数はthe_post_thumbnailらしいので、コレのソースを追ってみたところ、ざっくりこんな感じだった。
1. get_the_post_thumbnail
2.1. get_post_thumbnail_id
@joyrexus
joyrexus / README.md
Last active May 3, 2024 10:41 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@CLCL
CLCL / centos6_mod_geoip.md
Last active September 8, 2016 22:34
CentOS 6で稼働しているdtpwiki.jpのWikiサイトに外国からのスパム書き込みが激しいので、GeoIPというIPアドレスから国を判別するApacheモジュールをインストールして、対応した。なお、mod_security使うと書き込み内容でBANすることができるのですが、あれけっこう設定がパラノイアなので、導入時にしっかりテストをする必要があるかな。

CentOS 6のApacheで外国のspamロボットのアクセスを制限する

すべて root で作業しています。

GeoIPとmod_geoipのインストール

GeoIP関連パッケージはEPELにありますので、あらかじめEPELの設定をしたうえで、

# yum --enablerepo=epel install GeoIP mod_geoip
@yoshifumi0521
yoshifumi0521 / Twitterの文字制限のあるテキストエリア
Created January 15, 2013 23:52
Twitterの140文字制限のUIがよかったので、実装してみた。jQueryを使用。
//テキストエリア
<textarea id="text_area"></textarea>
//残りの文字数の表示
<p>残りの文字数 <span="count"></p>
//送信ボタン
<input type="submit" value="送信" id="submit">
<script>
@rokkohorosi
rokkohorosi / gist:4282291
Created December 14, 2012 02:59
スマホの画面タップ時に要素をhoverさせる CSSは、a:hoverの代わりにa.hoverを使う aタグ以外の場合はclassにtapを指定するとCSSで:hoverの代わりに.hoverを使えるようになる
(function () {
var tapClass = "";
var hoverClass = "";
var Hover = window.Hover = function (ele) {
return new Hover.fn.init(ele);
};
Hover.fn = {
//Hover Instance
init : function (ele) {