This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ssh -L 8082:whatever.com:80 [email protected] #tunnelIP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.google.common.collect.ImmutableSet; | |
| import com.google.common.collect.Lists; | |
| import java.util.*; | |
| List<Whatever> list = Lists.newArrayList(); | |
| Lists.newArrayList(ImmutableSet.copyOf(list)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.lang.invoke.MethodHandles; | |
| private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var oracledb = require('oracledb'); | |
| dbquery = function(user, pass, db, query, callback) { | |
| oracledb.getConnection({ user : user, password : pass, connectString : db }, function(err, connection) { | |
| if (err) { | |
| callback("Couldn't connect to db " + db + " got an error " + err, null); | |
| } | |
| connection.execute(query, function(err, result) { | |
| if (err) { | |
| callback("Couldn't execute query in db " + db + " got an error " + err, null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var ping = require ("net-ping"); | |
| var session = ping.createSession(); | |
| var target = process.argv[2]; | |
| pingit = function(target, callback) { | |
| session.pingHost(target, function (error, target) { | |
| var result; | |
| if (error) { | |
| result = target + ": " + error.toString (); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var t0 = performance.now(); | |
| function(); | |
| var t1 = performance.now(); | |
| console.log("Call to function took " + (t1 - t0) + " milliseconds.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var SHA256 = require("crypto-js/sha256"); | |
| sha256 = function(string, callback) { | |
| var hash = SHA256(string); | |
| callback(hash.toString()); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Hashids = require("hashids"); | |
| encode = function(string, salt, callback) { | |
| var hashids = new Hashids(decodeURIComponent(salt)); | |
| var id = hashids.encode(parseInt(string)); | |
| callback(id); | |
| } | |
| decode = function(string, salt, callback) { | |
| var hashids = new Hashids(decodeURIComponent(salt)); |