Skip to content

Instantly share code, notes, and snippets.

@sakadonohito
sakadonohito / study.js
Last active December 21, 2015 16:09
jQueryを中心にJavaScriptメモ
//配列を作成する
var width_arr = new Array();
//jQueryで階層指定及び最初の要素を指定する
//下の例だと、id=estimateList配下のtbody配下の最初のtr配下のtd全て
var tbody_tds = $('#estimateList tbody tr:first-child td');
//jQueryで繰り返し処理
$.each($(tbody_tds),function(i){
width_arr.push($(this).width());
@sakadonohito
sakadonohito / resize-list.js
Created August 25, 2013 02:47
要素をjQueryのtoggle()でたたんだり表示したりした時に他の要素の高さを変えて画面を余らせないようにする
$(function(){
$('#toggle-button-search-form').click(function(){
var _search_form = $('#toggle-search-form');
$(_search_form).toggle();
if(_search_form.is(":hidden")){
$('#list-box').height(580);
$('#list-box div.scroll').height(580);
}else{
$('#list-box').height(380);
$('#list-box div.scroll').height(380);
@sakadonohito
sakadonohito / adjust-size.js
Created August 25, 2013 02:43
ヘッダ固定でボディだけスクロールさせる
$(function(){
function table_adjust(){
var width_arr = new Array();
var tbody_tds = $('#estimateList tbody tr:first-child td');
var thead_ths = $('#estimateList thead tr:first-child th');
$.each($(tbody_tds),function(i){
width_arr.push($(this).width());
});
$.each($(thead_ths),function(i){
$(this).width(width_arr[i]);
@sakadonohito
sakadonohito / inVisible.css
Created August 25, 2013 02:39
for blog 表示させない要素を簡単に作るクラス指定
.inVisible {
display: none;
}
@sakadonohito
sakadonohito / responsive-body.css
Created August 25, 2013 02:32
for blog windowサイズに応じてCSSを変化させる
body {
padding-top: 60px;
}
/* ブラウザの横幅が980px以下の時 */
@media (max-width: 980px){
body {
padding-top: 0px;
}
}
@sakadonohito
sakadonohito / win8shortcuts.md
Last active December 14, 2015 04:39
Windows8のwindowsキーと組み合わせのショートカット

Windows8 ショートカット集

※英字配列での記述[]内が日本語配列

起動

  • win+ ret ナレーターモード起動
  • win+1~10 タスクバーに登録されているものの左から1,2,,,で起動
  • win+ =[^] 画面拡大モード起動 ※使い方不明
  • win+ e エクスプローラー起動
@sakadonohito
sakadonohito / start.rb
Created October 24, 2012 14:35
for blog
#/usr/bin/ruby
require 'rubygems'
require 'sinatra'
require 'model/comment.rb'
require 'sass'
helpers do
include Rack::Utils;alias_method :h, :escape_html
#追加
@sakadonohito
sakadonohito / fmbbs.haml
Created October 24, 2012 14:32
for blog
%form{:method=>"POST",:action => '/fmcomment'}
%input{:type=>"hidden",:name=>"_method",:value=>"PUT"}
%table
%tr
%td 名前
%td
%input{:type=>"text",:name=>"name"}
%tr
%td タイトル
%td
@sakadonohito
sakadonohito / comment.rb
Created October 24, 2012 14:27
for blog
require 'rfm'
class FMServer
def initialize()
@FM_CONFIG = {
:host => "FileMakerServerの接続先IP",
:account_name => "FileMakerFileのログインアカウント",
:password => "FileMakerFileのログインパスワード",
:database => "FileMakerFileの名前",
:ssl => false,
:root_cert => false,
@sakadonohito
sakadonohito / image_download.py
Created October 22, 2012 00:43
特定のURL内の画像が数字の連番の場合の画像取得サンプル
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys, urllib
import os.path
def download(url):
img = urllib.urlopen(url)
localfile = open( os.path.basename(url), 'wb')
localfile.write(img.read())