Skip to content

Instantly share code, notes, and snippets.

@LCamel
LCamel / AAA.java
Last active Jun 5, 2020
sftp / jsch
View AAA.java
import com.jcraft.jsch.ChannelSftp;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import java.util.Vector;
class JSCHLogger implements com.jcraft.jsch.Logger {
public JSCHLogger() {
}
View AA.java
package lcamel;
import java.util.LinkedHashSet;
import java.util.Set;
public class AA {
static final int L = 1;
static final int H = 100;
// all possible weight combinations
static int[][] wss = new int[][] {
View schema.json
{
"type": "record",
"name": "DumpData",
"namespace": "com.oath.affiliate.data_collector",
"fields": [
{
"name": "level1Categories",
"type": [
"null",
{
@LCamel
LCamel / a.cpp
Created Dec 12, 2016
Print with error messages
View a.cpp
// https://www.ptt.cc/bbs/Programming/M.1481568735.A.6D7.html
// g++ -std=c++0x -ftemplate-depth=1001 a.cpp 2>&1 | grep -oP '(?<=Print<)\d+'
template <int i> struct Print { enum : int {
v = (void) i // die!
};};
template <int i, bool b> struct Test { enum : int {
v = 42
};};
template <int i > struct Test<i, false> { enum : int {
View foo.js
var async = require('async');
(function () {
var tmp;
async.series(
[
(cb) => { console.log("1"); tmp = "foo"; cb(null, "result1"); },
(cb) => { console.log("2"); cb(null, tmp + " result2"); },
],
(err, results) => { console.log("result: " + results); }
@LCamel
LCamel / a.js
Last active Jun 22, 2016
typeof null
View a.js
function f() { return typeof null === "object"; }
console.log(f());
// for (var i = 0; i < 10000; i++) f();
%OptimizeFunctionOnNextCall(f);
console.log(f());
console.log(process.versions.v8)
View AA.java
import java.lang.reflect.Constructor;
public class AA {
public static void main(String[] args) throws InterruptedException {
f1();
}
private static void f1() {
int i = 3;
String s = "foo";
Runnable r = new Runnable() {
View 3d.html
<html>
<head>
</head>
<body id="body" bgcolor="black">
<div class="wrap" style="left: 500px; top: 100px">
<div class="cube">
<div class="front">🙊</div>
<div class="back" style="background: #44ff44; font-size: 400%"></div>
View gist:4435e51b089a41d86821
# This is the default .slate file.
# If no ~/.slate file exists this is the file that will be used.
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Resize Bindings
#bind right:alt resize +10% +0
#bind left:alt resize -10% +0