- まず、こわくないgit を読む。
- 具体的な手順は、GitHubへpull requestする際のベストプラクティス を参考にする。
- すでに自分のgithubレポジトリに
push
しちゃった場合は、普通のpush
ができません。でも、git push -f
がちょっとやだなーという人は、 Rebase on github branch にあるように、rebase
してからプルリクエストを送るためのブランチを作ってしまうのがきっと良い。
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 Text.Regex.TDFA | |
import Data.Time.Format | |
import Data.Time.Clock | |
import System.Locale | |
import Data.Maybe | |
import qualified Data.ByteString.Lazy.Char8 as B | |
parseTimestamp :: B.ByteString -> UTCTime | |
parseTimestamp s = fromJust $ parseTime defaultTimeLocale "%F %T%Q/%Z" (B.unpack s) |
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 sshlog () { | |
if [ "x$1" = "x" ]; then | |
echo "simple logging wrapper for ssh." | |
echo "use as usual ssh" | |
ssh | |
else | |
TARGET=$1 | |
mkdir -p ~/ssh-log | |
LOGFILE=~/ssh-log/$TARGET.$(date +%Y-%m-%d_%H.%M.%S).log | |
ssh $@ | python $HOME/timestamp-logger.py $LOGFILE |
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 'rexml/document' | |
def showxml(fn) | |
doc = REXML::Document.new(open(fn)) | |
doc.elements.each("//.") { |e| | |
x=e | |
ps = [] | |
while x != nil do | |
ps << x.name | |
x = x.parent |
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
(defn luhn-check-digit [numStr] | |
(let [char-to-integer (fn [c] (Integer/parseInt (str c))) | |
prod-tuple (fn [t] (* (t 0) (t 1))) | |
sum-digits (fn [n] (if (> n 9) (- n 9) n))] | |
(->> numStr | |
reverse | |
(map char-to-integer) | |
(zip (cycle [2 1])) | |
(map (comp sum-digits prod-tuple)) | |
(reduce +) |
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
(ns cl1.core) | |
(defn prod-digits | |
[ps] | |
(->> ps | |
(map #(reduce * %1)) | |
(map #(cond | |
(> %1 9) (- %1 9) | |
:else %1)) | |
(reduce +))) |
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
#define IR_RECV_PIN 2 | |
#define IR_TIMEOUT_USEC 1000000 | |
void setup() | |
{ | |
Serial.begin(115200); | |
pinMode(IR_RECV_PIN, INPUT); | |
} | |
void loop() |
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
// project/pugins.sbt: | |
// addSbtPlugin("io.gatling" % "sbt-plugin" % "1.0") | |
name := "gatling example" | |
version := "1.0" | |
scalaVersion := "2.10.4" | |
libraryDependencies ++= Seq( |
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
# Name: Makefile | |
# Author: <insert your name here> | |
# Copyright: <insert your copyright message here> | |
# License: <insert your license reference here> | |
# This is a prototype Makefile. Modify it according to your needs. | |
# You should at least check the settings for | |
# DEVICE ....... The AVR device you compile for | |
# CLOCK ........ Target AVR clock rate in Hertz | |
# OBJECTS ...... The object files created from your source files. This list is |
OlderNewer