(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
var xhr = function() { | |
var xhr = new XMLHttpRequest(); | |
return function( method, url, callback ) { | |
xhr.onreadystatechange = function() { | |
if ( xhr.readyState === 4 ) { | |
callback( xhr.responseText ); | |
} | |
}; | |
xhr.open( method, url ); | |
xhr.send(); |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
const http = require('http'); | |
const urls = process.argv.slice(2, process.argv.length); | |
let fetchData = function(url){ | |
return new Promise(function(resolve, reject) { | |
http.get(url, (res)=>{ | |
let data = ''; | |
res.setEncoding('utf8'); | |
//res.resume(); | |
res.on('data',(chunk)=>{ |
#compdef flutter | |
#autoload | |
# in order to make this work, you will need to have Flutter installed | |
# | |
# flutter zsh completion, based on adb completion | |
local -a _1st_arguments | |
_1st_arguments=( | |
'analyze:Analyze the project''s Dart code' |
// dm Klopapier Widget | |
// | |
// Copyright (C) 2020 by marco79 <marco79cgn@gmail.com> | |
// | |
// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. | |
// | |
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL | |
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | |
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER | |
// IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE |
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
#!/usr/bin/env bash | |
function p() { | |
jq -n \ | |
--arg content "$*" \ | |
'{ | |
"model": "pplx-7b-online", | |
"messages": [ | |
{ | |
"role": "system", | |
"content": "Be precise and concise." |