Skip to content

Instantly share code, notes, and snippets.

View wingyplus's full-sized avatar
😶‍🌫️
Burned out

Thanabodee Charoenpiriyakij wingyplus

😶‍🌫️
Burned out
View GitHub Profile
#include <stdio.h>
/*
X A B
-->
-->
<--
<--
*/
package com.github.wingyplus.sparktut; /**
* Created by wingyplus on 12/15/2015 AD.
*/
import java.util.ArrayList;
import java.util.List;
public class MainApp {
import jenkins.model.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.common.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.plugins.credentials.impl.*
import com.cloudbees.jenkins.plugins.sshcredentials.impl.*
import hudson.plugins.sshslaves.*;
domain = Domain.global()
store = Jenkins.instance.getExtensionList('com.cloudbees.plugins.credentials.SystemCredentialsProvider')[0].getStore()
"use strict";
class Car {
constructor() {
this.isStarted = false;
}
start() {
return new Promise((resolve, reject) => {
@wingyplus
wingyplus / isexist_vs_isnotexist.go
Created February 11, 2016 07:00 — forked from mastef/isexist_vs_isnotexist.go
os.IsExist(err) vs os.IsNotExist(err)
/*
Watch out, os.IsExist(err) != !os.IsNotExist(err)
They are error checkers, so use them only when err != nil, and you want to handle
specific errors in a different way!
Their main purpose is to wrap around OS error messages for you, so you don't have to test
for Windows/Unix/Mobile/other OS error messages for "file exists/directory exists" and
"file does not exist/directory does not exist"
"use strict";
function validateUsername(username) {
return true;
}
describe("validateUsername", () => {
["abc", "longusername"].forEach((username) => {
it(`should valid for username ${username}`, () => {
expect(validateUsername(username)).toBeTruthy();
"use strict";
let http = require("http");
let url = require("url");
const STATUS_NOT_FOUND = 404;
let handlerMap = {};
module.exports = {
@wingyplus
wingyplus / Main.java
Created November 24, 2015 03:16
Test 1000 == 1000
public class Main {
public static void main(String ... args) {
System.out.println(Integer.valueOf(100) == Integer.valueOf(100)); // true
System.out.println(Integer.valueOf("100") == Integer.valueOf(100)); // true
System.out.println(Integer.valueOf("100") == Integer.valueOf(100)); // true
System.out.println(Integer.valueOf(1000) == Integer.valueOf(1000)); // false
System.out.println(Integer.valueOf("1000") == Integer.valueOf(1000)); // false
System.out.println(Integer.valueOf(1000).equals(Integer.valueOf(1000))); // true
}
#!/bin/sh
fetch_jenkins_cli() {
wget http://127.0.0.1:8080/jnlpJars/jenkins-cli.jar -O jenkins-cli.jar
}
install_jenkins() {
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
echo 'deb http://pkg.jenkins-ci.org/debian binary/' > /etc/apt/sources.list.d/jenkins.list
apt-get update && apt-get install -y jenkins
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
public class Main {
private static String USER_NAME = "*****"; // GMail user name (just the part before "@gmail.com")
private static String PASSWORD = "********"; // GMail password
private static String RECIPIENT = "lizard.bill@myschool.edu";