-
abs(float)
- Returns the absolute value of a given float. Example:abs(1)
returns1
, andabs(-1)
would also return1
, whereasabs(-3.14)
would return3.14
. See also thesignum
function. -
basename(path)
- Returns the last element of a path. -
base64decode(string)
- Given a base64-encoded string, decodes it and returns the original string.
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
/* | |
Based on the video's and blogposts of Mat Ryer (@matryer).. | |
- https://pace.dev/blog/2018/05/09/how-I-write-http-services-after-eight-years.html | |
- https://www.youtube.com/watch?v=FkPqqakDeRY | |
- https://www.youtube.com/watch?v=rWBSMsLG8po | |
.. I derived the following starting point for a GO HTTP REST server. It can be used to add all explained (see above) concepts. | |
You could spread the code below in separate files as follows: |
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
#!/bin/sh | |
# defaultenv.sh - Load environment variable defaults and run programs | |
set -e | |
[ x"$DEBUG" = "x1" ] && set -x | |
_load_envrc () { | |
local file="$1"; shift | |
if [ -r "$file" ] ; then | |
# Bourne shell limits how we can test and set env vars, so here I'm |
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
cmake_minimum_required(VERSION 3.7) | |
project(esp_vt100_firmware) | |
set(CMAKE_CXX_STANDARD GNU99) | |
set(SOURCE_FILES | |
include/uart_hw.h | |
include/user_config.h | |
user/io.c | |
user/io.h |
The following are instructions for building a GCC cross-compiler for the MSP430. They are based in part on Peter Bigot's post to mspgcc-users.
export PREFIX=/usr/local/msp430
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
/** | |
* AppleScript to launch iterm2 terminals/tabs with configurable: | |
* ~ Name <name> | |
* ~ List of commands <cmds> | |
* ~ Split behavior horizontal(h) or vertical(v) <split> :: (h, v) | |
* | |
* Run from terminal with `osascript iterm-launcher.js`. | |
* Don't unfocus with the mouse/keyboard while executing the script. | |
* | |
* JS port of https://github.com/luismartingil/scripts/blob/master/iterm_launcher02.applescript |
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
class @BaseCtrl | |
@register: (app, name) -> | |
name ?= @name || @toString().match(/function\s*(.*?)\(/)?[1] | |
app.controller name, this | |
@inject: (annotations...) -> | |
ANNOTATION_REG = /^(\S+)(\s+as\s+(\w+))?$/ | |
@annotations = _.map annotations, (annotation) -> |
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
dl.job-info{ | |
width:100%; | |
overflow:hidden; | |
} | |
dl.job-info dt { | |
font-weight:600; | |
float:left; | |
width:49%; |
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
package main | |
import ( | |
"crypto/tls" | |
"crypto/x509" | |
"fmt" | |
"io" | |
"log" | |
) |
NewerOlder