Skip to content

Instantly share code, notes, and snippets.

@xgdgsc
xgdgsc / gist:c97e96046ff77c49017e81919aba507b
Created Feb 19, 2021
linux 搜狗输入法 隐藏状态栏
View gist:c97e96046ff77c49017e81919aba507b
进入sougou的配置目录
vim $HOME/.config/sogoupinyin/conf/env.ini
找到StatusAppearance 设置为
StatusAppearance=0
@xgdgsc
xgdgsc / clash filter auto switch.yml
Last active Jan 13, 2021
clash filter auto switch load-balance example
View clash filter auto switch.yml
code: |
module.exports.parse = (raw,{ yaml }) => {
const rawObj = yaml.parse(raw)
var proxy_groups = rawObj["proxy-groups"]
var valid_arr = []
var select_i = 0
for(var i = 0; i < proxy_groups.length; i++) {
var obj = proxy_groups[i];
if(obj["name"].localeCompare("♻️ 自动选择")==0){
for(var j=0;j<obj["proxies"].length;j++){
View gist:1667c7bbe5b260feda9be5e84e418201
initialized
workspace/didChangeConfiguration
IntelliSense Engine = Default.
Autocomplete is enabled.
Enhanced Colorization is enabled.
Error squiggles are enabled if all header dependencies are resolved.
File exclude: **/.git
File exclude: **/.svn
File exclude: **/.hg
File exclude: **/CVS
@xgdgsc
xgdgsc / confirm.go
Created May 26, 2018 — forked from r0l1/confirm.go
Go (golang): How to ask for user confirmation via command line
View confirm.go
/* MIT License
*
* Copyright (c) 2017 Roland Singer [roland.singer@desertbit.com]
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@xgdgsc
xgdgsc / README-setup-tunnel-as-systemd-service.md
Created Oct 26, 2017 — forked from drmalex07/README-setup-tunnel-as-systemd-service.md
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward
View README-setup-tunnel-as-systemd-service.md

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
View compressed_csv_reader.h
#pragma once
#include <iostream>
#include <sstream>
#include <vector>
#include <boost/algorithm/string.hpp>
#include <boost/iostreams/copy.hpp>
#include <boost/iostreams/filter/bzip2.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/iostreams/filtering_stream.hpp>
@xgdgsc
xgdgsc / pomo_reminder.py
Created Sep 18, 2017
pomotodo task switch reminder
View pomo_reminder.py
import requests
import json
from datetime import datetime, timedelta
import os
if os.name == 'nt':
from win10toast import ToastNotifier
toaster = ToastNotifier()
//from config import *
POMO_URL='https://api.pomotodo.com/1/pomos'
View tail-slack.sh
#!/bin/bash
tail -n0 -F "$1" | while read LINE; do
(echo "$LINE" | grep -e "$3") && curl -X POST --silent --data-urlencode \
"payload={\"text\": \"$(echo $LINE | sed "s/\"/'/g")\"}" "$2";
done
@xgdgsc
xgdgsc / .bashrc
Created Jun 6, 2017 — forked from copperlight/.bashrc
Window Subsystem for Linux ssh-agent Configuraton
View .bashrc
# ... more above ...
# wsfl bash is not a login shell
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# ssh-agent configuration
if [ -z "$(pgrep ssh-agent)" ]; then
rm -rf /tmp/ssh-*
@xgdgsc
xgdgsc / date_conversion.cpp
Created Mar 20, 2017 — forked from st-j/date_conversion.cpp
Convert between boost dates and Unix timestamps (time_t)
View date_conversion.cpp
#include <ctime>
#include <iostream>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
//==============================================================================
//! Convert date part of Unix timestamp (time_t) to boost date
//!