Skip to content

Instantly share code, notes, and snippets.

View sdesalas's full-sized avatar
🕹️

Steven de Salas sdesalas

🕹️
View GitHub Profile
@sdesalas
sdesalas / scar_tissue.md
Created May 28, 2023 16:30 — forked from gtallen1187/scar_tissue.md
talk given by John Ousterhout about sustaining relationships

"Scar Tissues Make Relationships Wear Out"

04/26/2103. From a lecture by Professor John Ousterhout at Stanford, class CS142.

This is my most touchy-feely thought for the weekend. Here’s the basic idea: It’s really hard to build relationships that last for a long time. If you haven’t discovered this, you will discover this sooner or later. And it's hard both for personal relationships and for business relationships. And to me, it's pretty amazing that two people can stay married for 25 years without killing each other.

[Laughter]

> But honestly, most professional relationships don't last anywhere near that long. The best bands always seem to break up after 2 or 3 years. And business partnerships fall apart, and there's all these problems in these relationships that just don't last. So, why is that? Well, in my view, it’s relationships don't fail because there some single catastrophic event to destroy them, although often there is a single catastrophic event around the the end of the relation

@sdesalas
sdesalas / echo.js
Created August 3, 2022 09:30 — forked from bszwej/echo.js
Pure Node.js echo server, that logs all incoming http requests (method, path, headers, body).
const http = require('http');
const server = http.createServer();
server.on('request', (request, response) => {
let body = [];
request.on('data', (chunk) => {
body.push(chunk);
}).on('end', () => {
body = Buffer.concat(body).toString();
@sdesalas
sdesalas / createWallet.js
Created March 5, 2022 16:03 — forked from PraneshASP/createWallet.js
Create a bitcoin wallet with this simple script.
//Import dependencies
const bip32 = require('bip32')
const bip39 = require('bip39')
const bitcoin = require('bitcoinjs-lib')
//Define the network
const network = bitcoin.networks.bitcoin //use networks.testnet for testnet
// Derivation path
const path = `m/49'/0'/0'/0` // Use m/49'/1'/0'/0 for testnet
@sdesalas
sdesalas / parse_dotenv.bash
Created March 30, 2020 11:11 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@sdesalas
sdesalas / gandalf.css
Created April 4, 2019 13:34 — forked from evadav/gandalf.css
02 - Give style with CSS
body {
font-family: Arial, Helvetica, sans-serif;
}
.gandalf{
position:relative;
max-width: 420px;
height: 500px;
padding: 40px;
@sdesalas
sdesalas / quest.js
Last active April 4, 2019 13:25 — forked from evadav/quest.js
My first application Node.JS
process.stdin.resume()
process.stdin.setEncoding('utf8')
console.log('How old are you ? ')
process.stdin.on('data', (age) => {
console.log('you are' + age.trim() +'years old')
if (age > 99){
console.log ('Too old')
} else if (age < 1) {
console.log ('You have not been born yet')
process.stdin.resume()
process.stdin.setEncoding('utf8')
console.log('How old are you ? ')
process.stdin.on('data', (age) => {
console.log('You are ' + age.trim() + ' years old ')
if (age > 99){
console.log('Too old!!')
} else if (age < 0) {
@sdesalas
sdesalas / index.html
Last active March 28, 2019 16:15 — forked from santiagocodes/index.html
findThePrecious.com MC solution
<!DOCTYPE html>
<html lang="zxx">
<head>
<meta charset="UTF-8">
<title>findThePrecious.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
</head>
<body>
<nav>
<ul>
@sdesalas
sdesalas / JNI.cpp
Created November 24, 2018 13:31 — forked from Nimrodda/JNI.cpp
Raw JNI with async callbacks
static jclass callbacksClass;
static jobject callbacksInstance;
JNIEXPORT void JNICALL Java_com_example_NativeClass_nativeMethod(JNIEnv* env, jclass callingObject, jobject callbacks)
{
// Cache the Java callbacks instance
callbacksInstance = env->NewGlobalRef(callbacks);
// Cache the Java callbacks class (in case of interface, this will be the concrete implementation class)
jclass objClass = env->GetObjectClass(callbacks);
@sdesalas
sdesalas / readme.md
Created July 18, 2017 15:12 — forked from jobsamuel/readme.md
Run NodeJS as a Service on Ubuntu 14.04 LTS

Run NodeJS as a Service on Ubuntu 14.04 LTS

With Node you can write very fast JavaScript programs serverside. It's pretty easy to install Node, code your program, and run it. But > how do you make it run nicely in the background like a true server?

  • Go to /etc/init/
  • $ sudo vim yourapp.conf
  • Paste script.conf
  • $ sudo start yourapp
  • And when you wanna kill the process $ sudo stop yourapp