Skip to content

Instantly share code, notes, and snippets.

View HaveF's full-sized avatar
🎯
Focusing

HaveF HaveF

🎯
Focusing
View GitHub Profile
@gitchs
gitchs / calendar-dl.py
Created March 12, 2021 03:21
下载A股交易日历
#!/usr/bin/env python3
"""
从深圳交易所官网下载交易日历
深圳交易所:http://www.szse.cn/aboutus/calendar/
{
"zrxh": 2, -- 意义不明
"jybz": "1", -- 是否交易日,1是,0否;类型是str
"jyrq": "2021-03-01" -- 日历日期
}
@m-radzikowski
m-radzikowski / script-template.sh
Last active May 14, 2025 01:40
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@tomhicks
tomhicks / plink-plonk.js
Last active May 15, 2025 13:25
Listen to your web pages
@evgsil
evgsil / react-vis.d.ts
Last active October 23, 2019 08:15
Type Definitions for react-vis
declare module 'react-vis' {
import {
Component,
PureComponent,
ReactChild,
ReactNode,
SFC,
MouseEventHandler,
TouchEventHandler,
@posener
posener / go-shebang-story.md
Last active May 3, 2025 22:42
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@geerlingguy
geerlingguy / ansible-role-test.sh
Last active December 14, 2024 17:13
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
@dannypule
dannypule / json_to_csv.js
Created February 8, 2017 18:40
Export JSON to CSV file using Javascript
function convertToCSV(objArray) {
var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray;
var str = '';
for (var i = 0; i < array.length; i++) {
var line = '';
for (var index in array[i]) {
if (line != '') line += ','
line += array[i][index];
@nyanpasu64
nyanpasu64 / 0 Saga of the "Give Me CRX" Virus.md
Last active May 17, 2018 14:44
Saga of the "Give Me CRX" Virus

UPDATE

Adam Carbonell has created a non-malicious extension, called "Get CRX": https://chrome.google.com/webstore/detail/get-crx/dijpllakibenlejkbajahncialkbdkjc

Google has removed the original extension, along with several other extensions with similar malware.

Relavant links: