Skip to content

Instantly share code, notes, and snippets.

View xialu4820723's full-sized avatar
😉

lu.xia xialu4820723

😉
  • Bytedance
  • Shanghai, China
View GitHub Profile
@jehiah
jehiah / simple_args_parsing.sh
Created March 4, 2011 16:56
a simple way to parse shell script arguments
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@bclinkinbeard
bclinkinbeard / release.sh
Created November 1, 2011 20:22
Bash script to automate the Git Flow tag/release process
#!/bin/bash
# current Git branch
branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
# v1.0.0, v1.5.2, etc.
versionLabel=v$1
# establish branch and tag name variables
devBranch=develop
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

import os
import pytest
from alembic.command import upgrade
from alembic.config import Config
from project.factory import create_app
from project.database import db as _db
@joakinen
joakinen / certs.sh
Created March 17, 2014 09:03
Converting certificates
#!/bin/sh
# ____ _____ ____ _____ ___ _____ ___ ____ _ _____ _____ ____
# / ___| ____| _ \_ _|_ _| ___|_ _/ ___| / \|_ _| ____/ ___|
# | | | _| | |_) || | | || |_ | | | / _ \ | | | _| \___ \
# | |___| |___| _ < | | | || _| | | |___ / ___ \| | | |___ ___) |
# \____|_____|_| \_\|_| |___|_| |___\____/_/ \_\_| |_____|____/
# ____ _______ __
# | _ \| ___\ \/ /
@tgsoverly
tgsoverly / merge-xml-coverage.py
Created May 8, 2015 13:12
Merge Cobertura XML's
import sys
import os
import xml.etree.ElementTree as ET
import logging
import re
from shutil import copyfile
from optparse import OptionParser
### This file came from the https://github.com/flow123d/flow123d repo they were nice enough to spend time to write this.
### It is copied here for other people to use on its own.
@karpathy
karpathy / min-char-rnn.py
Last active July 24, 2024 18:36
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@josegonzalez
josegonzalez / redis_migrate.py
Last active April 25, 2024 02:34 — forked from iserko/redis_migrate.py
A simple script to migrate all keys from one Redis to another
#!/usr/bin/env python
import argparse
import redis
def connect_redis(conn_dict):
conn = redis.StrictRedis(host=conn_dict['host'],
port=conn_dict['port'],
db=conn_dict['db'])
return conn