-L
Specifies that the given port on the local (client) host is to be forwarded to
the given host and port on the remote side.
This file contains 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
#include <iostream> | |
#include <signal.h> | |
#include <ncurses.h> | |
#include <menu.h> | |
#include <string> | |
#include <unistd.h> | |
using namespace std; | |
#define SCREEN_MAIN 0 |
This file contains 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 sys, imaplib | |
server = '...' | |
user = '...' | |
passwd = '...' | |
try: | |
s = imaplib.IMAP4_SSL(server) | |
s.login(user, passwd) | |
a, b = s.status('INBOX', '(MESSAGES UNSEEN)') |
This file contains 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
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:fn="http://exslt.org/functions" | |
xmlns:my="http://example.com" | |
exclude-result-prefixes="fn my"> | |
<xsl:output method="xml"/> | |
<fn:function name="my:test"> | |
<fn:result select="'result123'"/> | |
</fn:function> |
This file contains 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
<!doctype html> | |
<title>touchevents</title> | |
<canvas id="canvas" width="500" height="300"></canvas> | |
<script> | |
function isTouchDevice() { | |
var el = document.createElement('div') | |
el.setAttribute('ongesturestart', 'return;') |
This file contains 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 Cocoa | |
let queue = Cocoa.OperationQueue() | |
let sema = DispatchSemaphore.init(value: 0) | |
queue.addOperation { | |
print("T1 Wait") | |
queue.addOperation { |
This file contains 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
const fs = require('fs') | |
const http = require('http') | |
const uploadFile = 'uploadMe.txt' | |
const req = http.request({ | |
hostname: 'localhost', | |
port: 8080, | |
path: '/uploadtest', | |
method: 'PUT', |
This file contains 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
#!/usr/bin/osascript -l JavaScript | |
// Open a new iTerm tab with a specified command. | |
// Usage example: ./openTermCommand.js '/usr/local/bin/vim /tmp/test.txt' | |
function run(argv) { | |
const iTerm = Application('iTerm') | |
iTerm.includeStandardAdditions = true | |
iTerm.activate() |
This file contains 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
#!/usr/bin/env node | |
const async = require('async') | |
const numTasks = 10 | |
const numParallel = 4 | |
function doTask(i) { | |
console.log(`${i} start`) | |
return new Promise((resolve, reject) => { |
This file contains 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
// https://github.com/andreypopp/autobind-decorator | |
// https://github.com/facebook/codemod | |
// Example replacement: | |
// - @autobind onClick(e: SyntheticEvent) { | |
// + onClick = (e: SyntheticEvent) => { | |
codemod -m -d . --extensions js \ | |
'@autobind\ ([a-zA-Z0-9]+)\(([^)]*)\)' \ | |
'\1 = (\2) =>' |
OlderNewer