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
#!/usr/bin/env bash | |
set -e | |
help() { | |
echo 'Usage: backup-docker-compose -t <tag_name> [docker-compose-working-directory]' | |
echo '' | |
echo ' e.g. $ backup-docker-compose -t v1.3.3-1 /data/deploy/nginx' | |
echo ' $ backup-docker-compose -t v1.3.3-1' | |
echo ' $ backup-docker-compose' |
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 pagination | |
import "fmt" | |
type Pair struct { | |
StartIndex int64 | |
EndIndex int64 | |
} | |
func newPair(l, r int64) Pair { |
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 | |
type Config struct { | |
Server struct { | |
Bind string `config:"default:0.0.0.0:9000;env:CONFIG_SERVER_BIND"` | |
Mode string `config:"default:debug;env:CONFIG_SERVER_MODE"` | |
} | |
} | |
var Data Config |
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 ( | |
"encoding/json" | |
"fmt" | |
"github.com/ismdeep/parser" | |
) | |
var contentA = `{"a": "123"}` | |
var contentB = `{"a": 123}` |
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
// InstallProvider.cpp : Defines the entry point for the console application. | |
// | |
#define UNICODE | |
#define _UNICODE | |
#include "stdafx.h" | |
#include <RPC.H> | |
#include <Rpcdce.h> | |
#include <Ws2spi.h> |
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
import os | |
import sys | |
def get_file_list(__dir__): | |
file_list = [] | |
for home, dirs, files in os.walk(__dir__): | |
for filename in files: | |
if filename[len(filename) - 3:] == '.in': | |
file_list.append(filename[:len(filename) - 3]) |
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
#include <stdio.h> | |
#define type_name(expr) \ | |
(_Generic((expr), \ | |
char: "char", unsigned char: "unsigned char", signed char: "signed char", \ | |
short: "short", unsigned short: "unsigned short", \ | |
int: "int", unsigned int: "unsigned int", \ | |
long: "long", unsigned long: "unsigned long", \ | |
long long: "long long", unsigned long long: "unsigned long long", \ | |
float: "float", \ |
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
#!/usr/bin/env python3.7 | |
import codecs | |
import csv | |
import os | |
import sys | |
import threading | |
import time | |
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
PROMPT=$' | |
%{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%H:%M:%S]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\ | |
%(!.#.$) ' | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="" | |
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
def is_number(num_str): | |
if len(num_str) <= 0: | |
return False | |
for _item_ in list(num_str): | |
if _item_ not in '0123456789': | |
return False | |
return True | |
def is_ip(s): |
NewerOlder