Skip to content

Instantly share code, notes, and snippets.

@idletekz
idletekz / smart-caps-lock.md
Created October 30, 2022 13:36 — forked from tanyuan/smart-caps-lock.md
Smart Caps Lock: Remap Caps Lock to Control AND Escape

Smart Caps Lock: Remap to Control AND Escape (Linux, Mac, Windows)

Caps Lock 變成智慧的 Control 以及 Escape

  • 單獨輕按一下就是 Escape
  • 若按下時同時按著其他鍵,就會是 Control

這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)

  • Send Escape if you tap Caps Lock alone.
@idletekz
idletekz / 01-curl.go
Created May 15, 2019 14:17 — forked from jmoiron/01-curl.go
io.Reader & io.Writer fun
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func init() {
@idletekz
idletekz / disableSSL.groovy
Created February 21, 2018 03:06 — forked from thomastaylor312/disableSSL.groovy
Disable SSL validation in Groovy
import javax.net.ssl.HostnameVerifier
import javax.net.ssl.HttpsURLConnection
import javax.net.ssl.SSLContext
import javax.net.ssl.TrustManager
import javax.net.ssl.X509TrustManager
def nullTrustManager = [
checkClientTrusted: { chain, authType -> },
checkServerTrusted: { chain, authType -> },
@idletekz
idletekz / README.md
Last active January 12, 2018 20:22 — forked from dnozay/_Jenkins+Script+Console.md
jenkins groovy scripts collection.
@idletekz
idletekz / reinvent-2017-youtube.md
Created December 26, 2017 20:44 — forked from stevenringo/reinvent-2017-youtube.md
Links to YouTube recordings of AWS re:Invent 2017 sessions

| Title | Description

@idletekz
idletekz / register a myget feed.markdown
Created July 21, 2017 15:34 — forked from xavierdecoster/register a myget feed.markdown
Store MyGet credentials in your roaming user profile NuGet.config

Execute the following script using your MyGet [feedUrl] and MyGet [username] , [password] and [apikey]. Run this from a commandline where you have access to nuget.exe (or set the path to your nuget.exe in a system environment variable).

Store credentials in machine-level nuget.config (non-transferable)

nuget setapikey [apikey] -source [feedUrl]
nuget sources add|update -Name [name] -source [feedUrl] -User [username] -pass [password]
@idletekz
idletekz / francois.email.groovy.template
Created July 19, 2017 17:50 — forked from francoisledroff/francois.email.groovy.template
A groovy template to send fancy html formatted emails through the jenkins email extension plugins. the associated email extension plugin is https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin One way to debug it is to use a groovy script through the jenkins script menu (http://localhost:8080/jenkins/script) cf. https://gist.github.com/f…
<!DOCTYPE html>
<head>
<title>Build report</title>
<style type="text/css">
body
{
margin: 0px;
padding: 15px;
}
@idletekz
idletekz / jenkins-build-flow-external.groovy
Created April 25, 2017 17:43 — forked from pokle/jenkins-build-flow-external.groovy
How to run an external script from source control in the Jenkins Build Flow plugin DSL
//
// Copy this into your Jenkins Build Flow plugin DSL, and call run_workspace_script() with the name of your checked in script
//
// Based on code at http://jorgemanrubia.net/2009/10/10/evaluating-code-dynamically-in-groovy
//
def run_workspace_script(filename) {
def code = new File(build.workspace.child(filename).toString()).text
def code_as_closure = "{->${code}}"
def closure = evaluate(code_as_closure)
closure.delegate=this
@idletekz
idletekz / jsonPrettyPrint.groovy
Created April 24, 2017 20:07 — forked from osima/jsonPrettyPrint.groovy
json pretty print using groovy
json = '{"twitter":"@osima.jp","web site":["http://osima.jp/","http://www.my-notebook.net/"]}'
println groovy.json.JsonOutput.prettyPrint(json)