This file contains hidden or 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
#include <stdio.h> | |
#include "yaml.h" | |
static void print_yaml_event(yaml_event_t *event) | |
{ | |
char *event_type; | |
switch (event->type) | |
{ | |
case YAML_NO_EVENT: |
This file contains hidden or 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
#!/usr/bin/env python | |
""" | |
The result of signal handler reentrance in Python 2.7 and 3.7 might different: | |
# For Python 2.7 | |
The signal handler will run in order. | |
``` | |
$ python2 signal_handler_reentrance.py |
This file contains hidden or 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/bash | |
NODEBASEPATH=/PATH/TO/NODEJS/INSTALLATION | |
SUBJECTCMD=`basename "${0}"` | |
export PATH=${NODEBASEPATH}/bin:$PATH | |
exec ${SUBJECTCMD} "${@}" |
This file contains hidden or 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/bash | |
# source ~/bin/env-protobuf.sh | |
OPT_BASE=~/bin/app | |
which protoc | |
if [ "$?" != "0" ]; then | |
export PATH=$PATH:${OPT_BASE}/protobuf-3.6.1/bin | |
echo "PATH=${PATH}" | |
fi |
This file contains hidden or 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 | |
/* | |
See if what would result in select under various channel conditions. | |
Outputs: | |
- On mode = 1 (worker-1): "Got error: error at 2017-10-15 19:33:00.687713221 ... (ok: true)" | |
- On mode = 2 (worker-2): "Got error: <nil> (ok: true)" | |
- On mode = 3 (worker-2): "Got error: <nil> (ok: false)" | |
- On mode = -9 (timeout): "Have context done." |
This file contains hidden or 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/bash | |
GOBASEPATH=/PATH/TO/GO/INSTALLATION | |
SUBJECTCMD=`basename "${0}"` | |
exec ${GOBASEPATH}/bin/${SUBJECTCMD} "${@}" |
This file contains hidden or 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
#include <endian.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
uint32_t to_grib_float(float r) { | |
union { | |
float f; | |
uint32_t i; | |
char c[4]; | |
} r_input; |
This file contains hidden or 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/bash | |
# source ~/bin/env-dart.sh | |
OPT_BASE=~/bin/app | |
which dart | |
if [ "$?" != "0" ]; then | |
export PATH=$PATH:${OPT_BASE}/dart/dart-sdk/bin | |
echo "PATH=${PATH}" | |
cat ${OPT_BASE}/dart/dart-sdk/version |
This file contains hidden or 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
import 'dart:mirrors'; | |
class ToDo { | |
final String who; | |
final String what; | |
const ToDo(this.who, this.what); | |
String toString() => "ToDo[${this.who}: ${this.what}]"; | |
} |
This file contains hidden or 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
import "dart:async"; | |
Future<DateTime> currentTime(int forExp) async { | |
DateTime now; | |
for (int i = 0; i < 3; i++) { | |
now = new DateTime.now(); | |
print("- exp${forExp}:current-time[${i}] = ${now}"); | |
} | |
return now; | |
} |
NewerOlder