This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 番号設定 | |
var num = "88"; | |
// 番号入力用のレイヤを設定 | |
var doc = Application.ActiveDocument; | |
var layers = doc.LayerTable; | |
var lname = "__SEQ_NO"; | |
// UNDO 処理を開始 | |
doc.UndoManager.BeginUndoUnit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"strings" | |
"fmt" | |
"golang.org/x/tour/wc" | |
) | |
func WordCount(s string) map[string]int { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "test/unit" | |
require "mocha/test_unit" | |
require "pry" | |
class Person | |
attr_accessor :name | |
def initialize(name) | |
self.name = name | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# depends on jquery | |
setDetailPageAction = -> | |
require modules, ($) -> | |
$elem = $('div#record-gaia').find('.target-element') | |
# Set default-focus | |
setTimeout () -> | |
$elem.focus(); | |
, 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$givenValue = 10 | |
function testIfSupportingClosure(){ | |
$givenValue = 4 | |
{ | |
$script:givenValue = $givenValue + 1 | |
echo "The givenValue is ${givenValue}." | |
}.GetNewClosure() | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
function calc() { | |
var num = 0; | |
for (var i=1; i<=10; i++) { | |
// 動きを追うにはconsole.logを色々な所で打ち込んでみよう! | |
console.log(num); | |
num += i; | |
} | |
return num; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// アロー構文 | |
var add = (a, b) => { | |
return a + b | |
} | |
add(1 ,9); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
console.log("start!!"); | |
// この時点ではまだ未定義(undefined) | |
// typeof() で変数の型を確認することができます | |
var x; | |
console.log("variable x is " + typeof(x)); | |
console.log("x = " + x); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//条件分岐 | |
var direction = "right"; | |
// 初期化してはじめて、型をnumberとして認識する | |
var x = 0, y = 0; | |
switch (direction) { | |
case "right": | |
x = x + 10; | |
break; | |
case "left": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import mysql.connector | |
def exec_sql(fn): | |
def wrapper(*args, **kw): | |
_self = args[0] | |
_self.con = mysql.connector.connect(**_self.rds_config) | |
ret = None | |
try: | |
ret = fn(*args, **kw) |
NewerOlder