Skip to content

Instantly share code, notes, and snippets.

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

KAZUKI Otsuhata k4zuki02h4t4

🏠
家で働く
View GitHub Profile
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

$.ajax({
url: "ajax.html",
success: function(data) {
alert('success!!');
},
error: function(data) {
alert('error!!!');
}
});
@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) {
@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>
@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
@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
})
@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
@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
@haribote
haribote / Basic of JavaScript
Last active October 3, 2016 06:13
"Basic of JavaScript"は、株式会社まぼろし( http://maboroshi.biz/ )の新人・若手向けJavaScript入門資料です。
# 目次
+ JavaScript オブジェクトと値の型