Skip to content

Instantly share code, notes, and snippets.

View geckotang's full-sized avatar
:octocat:

Shotaro Sakamaki geckotang

:octocat:
View GitHub Profile
/**
* ある位置から固定する
* @param selector {String} 固定したい要素のセレクタ
* @param fixedClassName {String} 固定したい要素につけ外すclass名
*/
function fixedNav(selector, fixedClassName) {
var nav = $(selector || '#js-fixednav'),
offset = nav.offset(),
$window = $(window);
/**
* 画面上部にスクロールする
* @param selector {String} クリックしてスクロールさせたい要素のセレクタ
* @param duration {Number} 移動速度
*/
function smoothScrollTop(selector, duration) {
var $topBtn = $(selector),
setting_scroll = {
duration: duration || 300
};
@geckotang
geckotang / gist:6192565
Created August 9, 2013 10:02
ボタンを長押しすると赤LEDが光る。再度長押しすると赤LEDが消えて緑LEDが光る。
/*
* ActionButton example
* Jeff Hoefs
* 11/3/11
*
* This example demonstrates a few diffrent ways to use the ActionButton
* library. You can attach event listeners, or poll for the changes in
* button state.
*
* Note that you must specify the button mode as the 2nd paramter of the
@geckotang
geckotang / gist:6195804
Created August 9, 2013 18:14
押した色に対応した色のLEDが付く
// LEDが接続されているピン
const int LED_1 = 13; // YELLOW
const int LED_2 = 12; // RED
// プッシュボタンが接続されているピン
const int BUTTON_1 = 8; // YELLOW
const int BUTTON_2 = 7; // RED
// 入力ピンの状態
int val_1 = 0; // YELLOW
@geckotang
geckotang / gist:6238629
Created August 15, 2013 06:09
5秒押したら点滅したままになる。 点滅したままに成った状態で、再度長押しすると変なことになる。
// Requrements
// ActionButton library by Jeff Hoefs
// https://github.com/soundanalogous/ActionButton/
#include <ActionButton.h>
const int ledPin_1 = 13; // RED
const int ledPin_2 = 12; // BLUE
const int btnPin_1 = 8; // RED
const int btnPin_2 = 7; // BLUE
@geckotang
geckotang / mba2013.markdown
Created August 16, 2013 01:14
MacBookAir2013 13inch

2013/08/16 よりセットアップ

やったこと

  • フルネーム:geckotang
  • アカウント名:geckotang
  • spotlight検索のショートカット(control+space)をオフに
  • トラックバッドの設定変更(カーソルの速度、右隅右クリック)
  • Finder>環境設定>詳細>すべてのファイル名拡張子を表示
  • Docを右側にして小さめ。
@geckotang
geckotang / memo.markdown
Last active December 21, 2015 16:18
grunt + styledocco + scss (compass)
@geckotang
geckotang / memo.md
Last active September 5, 2016 02:53
親がdisplay: table-*;の時、子のimg {max-width: 100%; }が効かない

img要素に対してのmax-widthが機能しない時があった

ためしたのが

  • display: table-header-group;
  • display: table-footer-group;
  • display: table-cell;

だったのでtable-*としてる。

@geckotang
geckotang / new_gist_file.scss
Last active December 23, 2015 21:59
fontawesome/scss/_mixins.scssをいじった。AlfredのWork flowsのFontAwesomeと組み合わせると便利。
@mixin fonta($name) {
&:before {
font-family: FontAwesome;
font-weight: normal;
font-style: normal;
display: inline-block;
text-decoration: inherit;
-webkit-font-smoothing: antialiased;
*margin-right: .3em;
@content;
// @link http://s-azcat.com/archives/389
int buttonA = 0;
int lastButtonA = 0;
int buttonB = 0;
int lastButtonB = 0;
unsigned long time1 = 0;
unsigned long time2 = 0;