Skip to content

Instantly share code, notes, and snippets.

module.exports = function(grunt) {
grunt.initConfig({
watch: {
// src/jsフォルダ以下のjs拡張子ファイルを対象に監視
files: ['src/js/*.js'],
// 変更があったらタスクjasmineを実行
tasks: ['jasmine']
},
jasmine: {
// プロパティ名はテストケース名
@maiko-ampersand
maiko-ampersand / Default.sublime-keymap
Created April 30, 2013 09:08
SublimeText2のプラグインを作ってみた ref: http://qiita.com/items/cd4509cbfd73e8ef591c
[
{
"keys": ["ctrl+b"], "command": "reple"
}
]
@maiko-ampersand
maiko-ampersand / gr_sketch.cpp
Created September 13, 2015 06:11
2015年9月13日 Mashup Awards 札幌マイコンハンズオン資料
/* GR-SAKURA Sketch Template V2.03 */
#include <Arduino.h>
#define INTERVAL 100
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
int ans ;
void setup()
{
pinMode(PIN_LED0,OUTPUT);
@maiko-ampersand
maiko-ampersand / file0.php
Created March 9, 2015 08:42
WordPressの投稿中の一番最初の画像のURLを取得する ref: http://qiita.com/se_ino/items/f9d08a1fe3c5f7c01f74
// 投稿内に出てくる一番最初の画像を取得する
function catch_post_image() {
global $post;
$first_img = '';
preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
if (isset($matches[1])) {
$first_img = $matches[1][0];
}
@maiko-ampersand
maiko-ampersand / TypeSquareSample
Created September 29, 2014 05:22
モリサワ TypeSquare利用サンプル
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>TypeSquareSample</title>
<script type="text/javascript" src="//typesquare.com/accessor/script/typesquare.js?NZ3DSAQ8E7o%3D" charset="utf-8"></script>
<style>
body {
font-size: 3em;
}
@maiko-ampersand
maiko-ampersand / file0.js
Created July 18, 2014 13:54
jQueryでシンプルなstickyのプラグイン ref: http://qiita.com/se_ino/items/b7e9839fcfcf7665ceca
(function($) {
'use strict';
$.fn.stickeyMenu = function(options) {
var $this = $(this);
var defaultSetting = {
startTop : 0 ,
stopTop : 0 ,
zIndex : 10
}
window.addEventListener('load',function(){
if(window.location.pathname === '/ajax/stream/inline.php') {
window.location = 'https://www.facebook.com/';
}
// 誕生日の友達がいる
var _birthdayLink = document.getElementById('birthday_reminders_link');
if (_birthdayLink) {
// クリックイベントを発火
_birthdayLink.click();
var _form = document.getElementsByClassName('uiStreamInlineAction');
{
"manifest_version": 2,
"name": "AutoCongrats",
"description": "ウェブ上の祝いなんてもんはただの文字列だ",
"version": "1.0",
"content_scripts": [ {
"all_frames": false,
"js": [ "js/background.js" ],
"matches": [ "http://www.facebook.com/*", "https://www.facebook.com/*"],
"run_at": "document_start"
<tr>
<td class="lsf symbol">table</td>
<td class="ligature">table, cell</td>
</tr>
@maiko-ampersand
maiko-ampersand / createIndex.js
Last active August 29, 2015 14:01
見出し一覧をつくるためのスクリプト
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
$.noConflict();
jQuery(document).ready(function(){
(function($){
// $('<ul></ul>') と同義だけども、左記の書き方をするとWPが勝手に閉じタグを入れるのでNG
var $_ul = $(document.createElement("ul"));
// 記事IDで選択スコープを絞ってね
$("#post-2420 h2, #post-2420 h3").each(function(){
var $_h = $(this);