Skip to content

Instantly share code, notes, and snippets.

@rauchg
rauchg / p.sh
Last active March 12, 2024 04:28
Perplexity CLI in pure shell
#!/usr/bin/env bash
function p() {
jq -n \
--arg content "$*" \
'{
"model": "pplx-7b-online",
"messages": [
{
"role": "system",
"content": "Be precise and concise."
@rauchg
rauchg / index.html
Created November 27, 2019 12:07
Next level Phone UX
<!DOCTYPE html>
<html>
<head>
<title>Next level UX</title>
<meta charset="UTF-8" />
</head>
<body>
<p>
<label>
const raw = require('raw-socket');
const ip = require('ip');
var options = {
protocol: raw.Protocol.ICMP
};
const sourceIp = '127.0.0.1';
const targetIp = '127.0.0.1';

Minimum Viable Async with Node 6

With the release of Node 6.0.0, the surface of code that needs transpilation to use ES6 features has been reduced very dramatically.

This is what my current workflow looks like to set up a minimalistic and fast microservice using micro and async + await.

The promise

@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter

From zero to microservice with 𝚫 now

The following guide will show you how to deploy a simple microservice written in JavaScript using 𝚫 now.

It uses Open Source tools that are widely available, tested and understood:

  • Node.JS
  • NPM
  • Express
@rauchg
rauchg / effective-es6.md
Last active July 11, 2023 09:38
Writing ES6 today, effectively.

Effective transpiling of ES6

After publishing my article on ECMAScript 6, some have reached out to ask how I exactly I make it all work.

I refrained from including these details on the original post because they're subject to immiment obsoletion. These tools are changing and evolving quickly, and some of these instructions are likely to become outdated in the coming months or even weeks.

The main tool

When evaluating the available transpilers, I decided to use 6to5, which has recently been renamed to Babel. I chose it based on:

@rauchg
rauchg / RealtimeConf2012.md
Created October 29, 2012 17:24 — forked from dshaw/RealtimeConf2012.md
Realtime Conf 2012 Talks
@rauchg
rauchg / README.md
Created March 16, 2012 21:05
~/.js/github.com.js

github.com.js

dotjs userscript for visualizing package.json files (if present) underneath the tree view.

Very useful for navigating Node.JS projects