title |
---|
Architecture |
Gio implements an Immediate Mode User Interface.. This approach can be implemented in multiple ways, however the overarching similarity is that the program:
- listens for events such as mouse or keyboard input,
#!/usr/bin/env bash | |
# Wrapper for gitmux to change some strings in ways that it doesn't | |
# allow for. Also replace 'origin' with a symbol for the git host. | |
WORKING_COPY=${1} | |
[[ -d ${WORKING_COPY} ]] || exit 1 | |
pushd $WORKING_COPY &> /dev/null | |
STATUS=$(git status) &> /dev/null || exit 2 | |
URL=$(git config --get remote.origin.url) &> /dev/null | |
if [[ "${STATUS}" =~ "No commits yet" ]] ; then |
title |
---|
Architecture |
Gio implements an Immediate Mode User Interface.. This approach can be implemented in multiple ways, however the overarching similarity is that the program:
func dumpByteSlice(b []byte) { | |
var a [16]byte | |
n := (len(b) + 15) &^ 15 | |
for i := 0; i < n; i++ { | |
if i%16 == 0 { | |
fmt.Printf("%4d", i) | |
} | |
if i%8 == 0 { | |
fmt.Print(" ") | |
} |
If you want resources offline to learn about programming and web technologies MDN is for you! and I recommend to use MDN over w3school because w3school is outdated.
Download it offline (2.1gb) at https://mdn-downloads.s3-us-west-2.amazonaws.com/developer.mozilla.org.tar.gz
Based on https://www.gnu.org/software/make/manual/html_node/Quick-Reference.html
Directive | Description |
---|---|
define variable define variable = define variable := define variable ::= define variable += define variable ?= endef |
Define multi-line variables. |
undefine variable |
Undefining variables. |
/* | |
Reliability and Flow Control Example | |
From "Networking for Game Programmers" - http://www.gaffer.org/networking-for-game-programmers | |
Author: Glenn Fiedler <[email protected]> | |
*/ | |
#include <iostream> | |
#include <fstream> | |
#include <string> | |
#include <vector> |
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) { | |
// path/to/whatever does not exist | |
} | |
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) { | |
// path/to/whatever exists | |
} |
#include <stdio.h> | |
void DumpHex(const void* data, size_t size) { | |
char ascii[17]; | |
size_t i, j; | |
ascii[16] = '\0'; | |
for (i = 0; i < size; ++i) { | |
printf("%02X ", ((unsigned char*)data)[i]); | |
if (((unsigned char*)data)[i] >= ' ' && ((unsigned char*)data)[i] <= '~') { | |
ascii[i % 16] = ((unsigned char*)data)[i]; |
'use strict'; | |
/** | |
* Mobiscroll directives set | |
* @type {*} | |
*/ | |
var mobiscroll = angular.module('mobiscroll', []); | |
/* | |
* Native style datetime picker | |
*/ |
TCL-Expect scripts are an amazingly easy way to script out laborious tasks in the shell when you need to be interactive with the console. Think of them as a "macro" or way to programmaticly step through a process you would run by hand. They are similar to shell scripts but utilize the .tcl
extension and a different #!
call.
The first step, similar to writing a bash script, is to tell the script what it's executing under. For expect
we use the following:
#!/usr/bin/expect