Skip to content

Instantly share code, notes, and snippets.

View daicham's full-sized avatar

Daisuke Takeuchi daicham

View GitHub Profile
@daicham
daicham / .gitlab-ci.yml
Last active May 3, 2023 07:05
A sample of .gitlab-ci.yml for a gradle project
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 / udpclient.js
Created November 26, 2014 00:56
Sample UDP Server and Client on node.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:1955543
Created March 2, 2012 04:04
Print the methods of Jenkins inner object on script console
//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 / gist:10253947
Last active June 1, 2021 22:02
SSH config for connecting to github and bitbucket over proxy
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 / gist:4528511
Last active January 9, 2019 13:14
zip/unzip on Powershell (depends on Ionic.Zip.dll)
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 / setpoxy.bat
Created February 9, 2017 09:57
Set proxy config for Win
@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 January 11, 2012 08:48
ruby code on windows bat file
@echo off
ruby -S -x %0 %*
goto end
#! ruby
# some ruby code
__END__
:end
pause
@daicham
daicham / build.gradle
Created August 11, 2016 06:55
A sample bulid.gradle of Spring Boot
buildscript {
ext {
springBootVersion = '1.4.0.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
@daicham
daicham / gist:4109527
Created November 19, 2012 08:08
A sample ruby code of executing SQL for Oracle
# 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
// 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])