Skip to content

Instantly share code, notes, and snippets.

Daisuke Takeuchi daicham

  • Tokyo, Japan
Block or report user

Report or block daicham

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@daicham
daicham / .gitlab-ci.yml
Last active Feb 18, 2020
A sample of .gitlab-ci.yml for a gradle project
View .gitlab-ci.yml
image: java:8-jdk
stages:
- build
- test
- deploy
before_script:
# - echo `pwd` # debug
# - echo "$CI_BUILD_NAME, $CI_BUILD_REF_NAME $CI_BUILD_STAGE" # debug
@daicham
daicham / gist:10253947
Last active May 31, 2019
SSH config for connecting to github and bitbucket over proxy
View gist:10253947
ProxyCommand "C:\Program Files\git\bin\connect.exe" -H proxy.example.com:8080 %h %p
Host github.com
HostName ssh.github.com
Port 443
IdentityFile C:\Users\hoge\.ssh\id_rsa
Host bitbucket.org
HostName altssh.bitbucket.org
Port 443
IdentityFile C:\Users\hoge\.ssh\id_rsa
@daicham
daicham / udpclient.js
Created Nov 26, 2014
Sample UDP Server and Client on node.js
View udpclient.js
// UDP Sample Client
// UDP 接続先
var host = "localhost";
var c_port = 41234;
var dgram = require("dgram");
var client = dgram.createSocket("udp4");
// サーバに送信するメッセージ
// var message = new Buffer("hello");
@daicham
daicham / gist:4528511
Last active Jan 9, 2019
zip/unzip on Powershell (depends on Ionic.Zip.dll)
View gist:4528511
function zip ($zipFilePath, $targetDir) {
# load Ionic.Zip.dll
[System.Reflection.Assembly]::LoadFrom(path\to\Ionic.Zip.dll)
$encoding = [System.Text.Encoding]::GetEncoding("shift_jis") # 日本語のファイルを扱うために必要
$zipfile = new-object Ionic.Zip.ZipFile($encoding)
$zipfile.AddDirectory($targetDir)
if (!(test-path (split-path $zipFilePath -parent))) {
mkdir (split-path $zipFilePath -parent)
@daicham
daicham / gist:1955543
Created Mar 2, 2012
Print the methods of Jenkins inner object on script console
View gist:1955543
//all job name
jenkins.model.Jenkins.instance.items.each {
println "Job: ${it.name}"
}
//method list of Jenkins instance
jenkins.model.Jenkins.instance.class.methods.each {
println "Jenkins method: ${it.name}"
}
@daicham
daicham / setpoxy.bat
Created Feb 9, 2017
Set proxy config for Win
View setpoxy.bat
@echo off
set PROXY_SERVER="proxy.example.com:80"
set PROXY_OVERRIDE="172.30.*"
echo *** Set proxy config ***
echo PROXY_ENABLE
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyEnable" /t REG_DWORD /d "1" /f
@daicham
daicham / gist:1593777
Created Jan 11, 2012
ruby code on windows bat file
View gist:1593777
@echo off
ruby -S -x %0 %*
goto end
#! ruby
# some ruby code
__END__
:end
pause
@daicham
daicham / build.gradle
Created Aug 11, 2016
A sample bulid.gradle of Spring Boot
View build.gradle
buildscript {
ext {
springBootVersion = '1.4.0.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
@daicham
daicham / gist:4109527
Created Nov 19, 2012
A sample ruby code of executing SQL for Oracle
View gist:4109527
# encoding: utf-8
#
# Prerequisite:
# gem install ruby-oci8
require 'oci8'
def log(message)
puts "#{Time.now.strftime("%Y-%m-%d %H:%M:%S")} #{message}"
end
View gist:5596593
// Proxy 設定は %USERPROFILE%\.groovy\preinit.bat に JAVA_OPTS として記述する。
// ex.)
// set JAVA_OPTS=%JAVA_OPTS% -Dhttp.proxyHost=proxyserver -Dhttp.proxyPort=8080 -Dhttp.proxyUser=username -Dhttp.proxyPassword=secret
// set JAVA_OPTS=%JAVA_OPTS% -Dhttps.proxyHost=proxyserver -Dhttps.proxyPort=8080 -Dhttps.proxyUser=username -Dhttps.proxyPassword=secret
@GrabResolver(name="kobo", root="https://repository-kobo.forge.cloudbees.com/release")
@Grab("org.jggug.kobo:gexcelapi:0.3")
import org.jggug.kobo.gexcelapi.GExcel
def book = GExcel.open(args[0])
You can’t perform that action at this time.