Skip to content

Instantly share code, notes, and snippets.

View cherenkov's full-sized avatar

cherenkov cherenkov

View GitHub Profile
@cherenkov
cherenkov / what_grade
Last active February 21, 2016 15:43
中学何年生かわかる便利スクリプト #pictruby
def main
age = Popup.input "中学何年生か計算します。年齢を入力してください。"
Popup.msg "中学#{age.to_i - 12}年生"
end
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script>
$(function() {
});
@cherenkov
cherenkov / fangate_sample.php
Created November 15, 2012 18:45
facebook. タブページのアプリのファンゲート
<?php
$signed_request = $facebook->getSignedRequest();
// pr($signed_request);
if (isset($signed_request['page']) && isset($signed_request['page']['liked'])) {
$pageLiked = $signed_request['page']['liked'];
} else {
if (isset($signed_request['user_id']) && $signed_request['user_id']) {
// ここでリロードさせることによって、次のアクセスで$signed_request['page']['liked']が取れる。
echo '<script>window.location = window.location;</script>';
@cherenkov
cherenkov / gist:4045645
Created November 9, 2012 13:23
xargsの限界?
echo . | xargs xdg-open
→正しく開かれる
ところが、
.zshrcに
function xdg_open_background() {
xdg-open $* &
}
alias o=xdg_open_background
@cherenkov
cherenkov / hateq_demo.html
Created November 4, 2012 21:25
jQueryを使用したスライドショーの表示について 今回、jQueryを.. - 人力検索はてな http://q.hatena.ne.jp/1351994896
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja" dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>jQuery SIMPLE SLIDESHOW</title>
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-script-type" content="text/javascript" />
<link rel="stylesheet" type="text/css" href="http://kotenbu.sakura.ne.jp/css/screen.css" media="all" />
<script type="text/javascript" src="http://kotenbu.sakura.ne.jp/js/jquery-1.5.2.min.js"></script>
<script type="text/javascript">
@cherenkov
cherenkov / test.user.js
Created November 2, 2012 21:01
firefox用のアドオン開発について質問です。 インストールしてお.. - 人力検索はてな http://q.hatena.ne.jp/1351864226
// ==UserScript==
// @name test
// @namespace http://d.hatena.ne.jp/Cherenkov/
// @description
// @include http://*
// @include https://*
// ==/UserScript==
document.getElementById('hoge').textContent = 'TEST';
@cherenkov
cherenkov / shebang.sublime-snippet
Created October 19, 2012 22:24
sublime text 2: shebang: # coding: utf-8
<snippet>
<content><![CDATA[
# coding: utf-8
]]></content>
<tabTrigger>shebang</tabTrigger>
<description>shebang: # coding: utf-8</description>
<scope>source.ruby</scope>
</snippet>
<?php
//PHP5.3でパーサーを作る勉強をしています。 http://ja.wikipedia.. - 人力検索はてな
//http://q.hatena.ne.jp/1350045786
function pr($var) {
echo '<pre>'; print_r($var); echo '</pre>';
}
header('Content-Type:text/html; charset=UTF-8');
require_once("./simplehtmldom/simple_html_dom.php");
@cherenkov
cherenkov / gist:3864275
Created October 10, 2012 09:12
sublime_config
{
"caret_style": "blink",
"color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme",
"draw_minimap_border": true,
"font_size": 11.0,
"highlight_line": false,
"ignored_packages":
[
"Groovy",
"LaTeX",
// ==UserScript==
// @name fb-thumbnail-selector
// @namespace http://d.hatena.ne.jp/Cherenkov/
// @include http://www.facebook.com/*
// @include https://www.facebook.com/*
// @grant GM_addStyle
// @grant GM_log
// @version 0.1
// @date 20121010
// ==/UserScript==