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
func Escape(sql string) string { | |
dest := make([]byte, 0, 2*len(sql)) | |
var escape byte | |
for i := 0; i < len(sql); i++ { | |
c := sql[i] | |
escape = 0 | |
switch c { | |
case 0: /* Must be escaped for 'mysql' */ |
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
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"requestedTheme": "dark", | |
"initialCols": 192, | |
"initialRows": 64, | |
"copyOnSelect": false, | |
"copyFormatting": false, | |
"defaultProfile": "{b9aeb94f-45e4-4c38-838d-f93e33045f4e}", | |
"profiles": { | |
"defaults": { |
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 | |
DOCKER_PS_DOCKER_PATH=${DOCKER_PS_DOCKER_PATH:-/usr/bin/docker} | |
DOCKER_PS_COLUMN_ORDER=${DOCKER_PS_COLUMN_ORDER:-CONTAINER ID,IMAGE,STATUS,NAMES} | |
${DOCKER_PS_DOCKER_PATH} ps $@ \ | |
| awk \ | |
-v ORDER="${DOCKER_PS_COLUMN_ORDER}" \ | |
-f $(dirname $0)/docker-ps.awk |
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 | |
if [ $# -ne 1 ]; then | |
echo "Usage: `basename ${0}` <profile>" | |
exit 1 | |
fi | |
cp ~/.ssh/id_rsa ~/.ssh/id_rsa.bak | |
cp ~/.ssh/id_rsa.pub ~/.ssh/id_rsa.pub.bak |
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
'use strict'; | |
const SqlBuilder = require('json-sql-builder2'); | |
const fs = require('fs'); | |
const path = require('path'); | |
module.exports = class DbHelper { | |
static async init(connection, name) { | |
await this.execute(connection, name, 'truncate'); | |
await this.execute(connection, name, 'seed'); |
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
A | B | C | |
---|---|---|---|
1 | 2 | 3 | |
4 | 5 | 6 | |
7 | 8 | 9 |
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
[ | |
{ | |
"col1": 123, | |
"col2": "ABC" | |
}, | |
{ | |
"col1": 234, | |
"col2": "BCD" | |
}, | |
{ |
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
JinBun - 仁文 |
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
using System; | |
using System.Xml.Linq; | |
namespace Mjollnir.Xml.Linq | |
{ | |
public static class XElementExtensions | |
{ | |
public static void Walk(this XElement element, Action<XNode> action) | |
{ | |
if (element == null) throw new ArgumentNullException(nameof(element)); |
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 Program | |
{ | |
static void Main(string[] args) | |
{ | |
Server.Run().ConfigureAwait(false).GetAwaiter().GetResult(); | |
} | |
} | |
static class Server | |
{ |
NewerOlder