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
// Based on https://dart-review.googlesource.com/c/sdk/+/125932/34/tests/standalone_2/io/unix_socket_test.dart | |
import 'dart:async'; | |
import 'dart:io'; | |
Future<void> main() async { | |
var address = InternetAddress('/tmp/socket', type: InternetAddressType.unix); | |
var server = await ServerSocket.bind(address, 0, shared: true); | |
server.listen((client) async { | |
client.listen((data) { |
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
-- Server code | |
libsocket = require "socket" | |
libunix = require "socket.unix" | |
socket = assert(libunix()) | |
SOCKET="/tmp/socket" | |
assert(socket:bind(SOCKET)) | |
assert(socket:listen()) | |
conn = assert(socket:accept()) | |
while 1 do | |
data=assert(conn:receive()) |
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
sudo installer -pkg ~/Downloads/node-v10.15.2.pkg -target / |
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
// Copied from typescript playground - https://www.typescriptlang.org/play/ | |
class Vector { | |
constructor(public x: number, public y: number, public z: number) { } | |
static times(k: number, v: Vector) { | |
return new Vector(k * v.x, k * v.y, k * v.z); | |
} |
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 StellarSdk = require('stellar-sdk'); | |
StellarSdk.Network.useTestNetwork(); | |
var server = new StellarSdk.Server('https://horizon-testnet.stellar.org'); | |
var sourceAccountPair = StellarSdk.Keypair.random(); | |
var destAccountPair = StellarSdk.Keypair.random(); | |
var astroDollar1 = new StellarSdk.Asset('AstroDollar1', sourceAccountPair.publicKey()); |
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 'dart:async'; | |
import 'dart:isolate'; | |
var mainReceivePort = new ReceivePort(); | |
main() async { | |
await Isolate.spawn(hello, null); | |
await for (var msg in mainReceivePort) { | |
print(msg); | |
return; |
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
java_binary( | |
name = 'hello', | |
main_class = 'HelloWorld', | |
deps = [':hello_lib'], | |
) | |
java_library( | |
name = 'hello_lib', | |
srcs = ['HelloWorld.java'], | |
resources = [], |
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.facebook.yoga.*; | |
public class HelloWorld { | |
public static void main(String s[]) { | |
YogaNode root = new YogaNode(); | |
root.setWidth(500); | |
root.setHeight(300); | |
root.setAlignItems(YogaAlign.CENTER); | |
root.setJustifyContent(YogaJustify.CENTER); | |
root.setPadding(YogaEdge.ALL, 20); |
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
##[https://github.com/docker/docker/issues/9697#issuecomment-67232206 Install specific version of docker (Ubuntu)]## | |
echo deb http://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list | |
apt-key adv --keyserver pgp.mit.edu --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
apt-get update | |
apt-get install -y lxc-docker-1.3.3 |
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
module RandomAlphaNumeric | |
@deck = [(0..9), ('a'..'z'), ('A'..'Z')].map { |i| i.to_a }.flatten | |
def self.generate(length) | |
@deck.shuffle[0, length].join | |
end | |
end |