Skip to content

Instantly share code, notes, and snippets.

View hkwid's full-sized avatar
😎
gemma

hkawaida hkwid

😎
gemma
View GitHub Profile
@hkwid
hkwid / formtest.html
Created January 14, 2014 22:49
form snippet
<form action="">
<input type="text">
<input type="text">
<input type="submit">
</form>
@hkwid
hkwid / todo.html
Created January 15, 2014 05:18
AngularJS todo list
<!doctype html>
<html lang="jp" ng-app>
<head>
<meta charset="UTF-8">
<title>todo</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.7/angular.min.js"></script>
<script src="myscript.js"></script>
<style>
.done-true {
color: gray;
@hkwid
hkwid / gist:8661858
Created January 28, 2014 03:31 — forked from xl1/gist:8651716

CSS Regions で計算をする

検証環境

Google Chrome 34.0.1797.2 (Official Build 246002) dev-m
OS  Windows 
Blink 537.36 (@165430)
enable-experimental-web-platform-features フラグ オン
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
//<h1 id="element-h1">指定要素</h1>
var elm = document.getElementById("element-h1");
//[getBoundingClientRect]を参照する
var rect = elm.getBoundingClientRect() ;
//ブラウザの左上からのX座標を取得する
var positionX = rect.left ;
//ブラウザの左上からのY座標を取得する
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
</head>
<body>
<h1>gist test</h1>
</body>
</html>
@hkwid
hkwid / addMenu.js
Last active January 4, 2016 20:00
google_app_script/addMenu
function onOpen() {
var menu = [
{name: "menu_title_1", functionName: "function_name_1"},
{name: "menu_title_2", functionName: "function_name_2"}
];
ss.addMenu("menu", menu); // ss: spreadsheet
}
@hkwid
hkwid / editEvent.js
Last active January 4, 2016 20:00
google_app_script/editEvent.js
function onEdit(e) {
if(e.source.getSheetName() === 'sheet_name'){
if(e.range.getColumn() === column_number) {
Browser.msgBox(e.value);
}
}
}
@hkwid
hkwid / resetSheet.js
Created January 4, 2016 19:44
google_app_script/resetSheet.js
function resetSheet() {
var _last_row = sheet.getLastRow();
var _last_column = sheet.getLastColumn();
var _range = sheet.getRange(2, 1, _last_row, _last_column);
_range.clear();
}
@hkwid
hkwid / convertToLetter.js
Created January 4, 2016 19:53
google_app_script/convertToLetter.js
/**
convert number to letter
e.g.1: 1 -> A
e.g.2: 100 -> CV
*/
function convertToLetter(iCol) {
var str = "";
var iAlpha = 0;
var iRemainder = 0;