Skip to content

Instantly share code, notes, and snippets.

suntong

Block or report user

Report or block suntong

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@suntong
suntong / simplest.js
Created May 31, 2020
gopherjs bare bone js code base
View simplest.js
this is simplest.js
@suntong
suntong / go_io-read_packages.md
Last active May 31, 2020
[go-nuts] Differences between os, io, ioutils, bufio, bytes (with Buffer type) packages for file reading
View go_io-read_packages.md

http://grokbase.com/t/gg/golang-nuts/142spmv4fe/go-nuts-differences-between-os-io-ioutils-bufio-bytes-with-buffer-type-packages-for-file-reading

I'm quite confused as there seems to be multiple redundant ways to solve my problem (read a file, parse the content, serve it via http). Most people on stackoverflow would use bufio, but I just can't get the differences between this package and the Buffer type of bytes and just reading a file with the os methods. Also I don't know when and why I should choose those ways to do it, when I have the simple, but non-versatile, ioutils.ReadFile.

View preseed.cfg
# See http://www.virtualbox.org/svn/vbox/trunk/src/VBox/Main/UnattendedTemplates/ubuntu_preseed.cfg
choose-mirror-bin mirror/http/proxy string
d-i apt-setup/use_mirror boolean true
# Packages, Mirrors, Image
d-i base-installer/kernel/override-image string linux-server
d-i base-installer/kernel/override-image string linux-image-amd64
d-i apt-setup/restricted boolean true
d-i apt-setup/universe boolean true
d-i pkgsel/install-language-support boolean false
View settings.json
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"alwaysShowTabs": true,
"defaultProfile": "{4c7ca763-cbe4-455b-98a1-9388ccdfb9c7}",
"initialCols": 120,
"initialRows": 30,
"keybindings": [
{
"command": "closeTab",
"keys": ["ctrl+w"]
View settings.json
// This file was initially generated by Windows Terminal 0.11.1191.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
View dbab-new.md

Configure dbab

The dbab best works with a second static IP address. To configure dbab (and to work with a local web server):

  1. Stop dbab-svr service
  2. Change the IP address that dbab uses to the second IP address
  3. Start dbab-svr service
  4. Start your local web server again if you have any. You may need to limit its listening port from 0.0.0.0 to your first static IP as well if necessary.

In details, do the following as root, again assuming that the server's own IP address is 192.168.0.101, and its second IP is 192.168.0.100.

View MockingBird JMeter Load Test.xml
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.2.1">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="MyTestPlan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
View starter-padplus-bot.js
#! /usr/bin/env node
const {
Wechaty,
config,
} = require('wechaty')
const { Message } = require('wechaty')
const { MessageType } = require('wechaty-puppet')
const { PuppetPadplus } = require('wechaty-puppet-padplus')
View goptions_demo.go
package main
import (
"fmt"
"os"
"time"
)
import (
"github.com/voxelbrain/goptions"
View picv.go
// -*- go -*-
////////////////////////////////////////////////////////////////////////////
// Program: picv
// Purpose: picture vault
////////////////////////////////////////////////////////////////////////////
package main
import (
"fmt"
You can’t perform that action at this time.