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
{ | |
"ToolVersion": "1.0.2.2", | |
"KeyboardLayout": 0, | |
"TypeNumber": "PD-ID120B", | |
"DipSwitch": [ | |
false, | |
false, | |
false, | |
false, | |
false, |
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 UIKit | |
import Foundation | |
let decoder = JSONDecoder() | |
let encoder = JSONEncoder() | |
struct ObsMessage { | |
struct OpCodeOnly { | |
let op: Int | |
} | |
struct Unknown: Codable { |
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
#!/usr/bin/env ruby | |
module Foo | |
module Bar | |
class Baz | |
def say | |
puts("i'm Baz") | |
end | |
end | |
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
#!/bin/bash | |
readonly DOC_ROOT=$(cd $(dirname ${BASH_SOURCE:-$0})/.. ; pwd) | |
if [ -z $1 ]; then | |
exit 1; | |
fi | |
cd $DOC_ROOT | |
mkdir -p $1/src |
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
#!/bin/bash | |
mkdir ~/bin | |
cat << EOT > ~/bin/dyndns-register.sh | |
#!/bin/bash | |
# Google Domainsの利用を決めているのでAPIを使った更新を仕込む | |
# DDClientがあればこれは不要のはず… | |
readonly GD_DDNS_USER='' |
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
#!/bin/bash | |
# $BASH_SOURCE == /path/to/repo/bin/doc_root.sh | |
readonly BIN_ROOT=$(cd $(dirname ${BASH_SOURCE:-$0}) ; pwd) | |
readonly DOC_ROOT=$(cd $(dirname ${BASH_SOURCE:-$0})/.. ; pwd) |
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
show_help() { | |
echo "Usage: ${BASH_SOURCE:-$0} [-h] [-d dir] <item>..." 1>&2 | |
echo " -d Output directory" 1>&2 | |
echo " -h Print this help" 1>&2 | |
} | |
while getopts d:h OPT | |
do | |
case "$OPT" in | |
d) |
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 UIKit | |
class RestorableTextField: UITextField { | |
@IBInspectable var defaultsKey: String = "" | |
required init?(coder aDecoder: NSCoder) { | |
super.init(coder: aDecoder) | |
self.addTarget(self, action: #selector(saveToUserDefaults(_:)), for: .editingDidEnd) | |
} |
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
fn main() { | |
// 標準的な変数束縛 | |
let first = 5; | |
println!("first: {}", first); | |
// let の左側の式はパターンであって、変数宣言というだけではない | |
// こういうこともできる | |
let (left, right) = (10, 20); | |
println!("left: {} right: {}", left, right); | |
// 詳細は別途パターンのセクションで |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sqlite3.h> | |
int exec_callback(void *, int, char**, char**); | |
int main(void){ | |
int result = 0; | |
sqlite3 *connection = NULL; | |
char* err_msq = NULL; |
NewerOlder