Skip to content

Instantly share code, notes, and snippets.

View silviaclaire's full-sized avatar

Claire Yan silviaclaire

View GitHub Profile
@maxdavid
maxdavid / tmuxfixer.js
Created May 21, 2019 21:31
Simple script for updating tmux config files, converting deprecated -fg, -bg, and -attr options to the combined -style option
#!/usr/bin/env node
/*
tmuxfixer.js
USAGE:
$ node tmuxfixer.js old-conf-path [new-conf-path]
PURPOSE & CONTEXT: This script takes in a tmux configuration file and combines
all deprecated -fg, -bg, and -attr into a single -style option line.
#!/usr/bin/env bash
usage="Usage: $(basename "$0") region stack-name [aws-cli-opts]
where:
region - the AWS region
stack-name - the stack name
aws-cli-opts - extra options passed directly to create-stack/update-stack
"
@tos-kamiya
tos-kamiya / sklearn_sample.py
Created April 3, 2016 08:55
習作: MeCabで分かち書きしてScikit-Learnでk-means法によるクラスタリング
# coding: utf-8
# ref: http://tt-house.com/2014/11/scikit-learn-text-clustering-python.html
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster import KMeans
from sklearn.decomposition import TruncatedSVD
from sklearn.preprocessing import Normalizer
import MeCab
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active June 4, 2024 10:14
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@tedmiston
tedmiston / nodejs-tcp-example.js
Last active May 20, 2024 11:27
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@tapsandswipes
tapsandswipes / ResetTag
Last active July 13, 2023 07:52
Reset tag in git
git push origin :refs/tags/<tagname> // Delete tag from remote
git tag -fa <tagname> // Reset tag to current commit
git push origin master --tags // Push tag to remote
@dAnjou
dAnjou / flask-upload
Created June 5, 2012 12:35
Flask upload example
<VirtualHost *>
ServerName example.com
WSGIDaemonProcess www user=max group=max threads=5
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi
<Directory /home/max/Projekte/flask-upload>
WSGIProcessGroup www
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
@panchicore
panchicore / bash
Created October 7, 2011 00:25
solve perl: warning: Setting locale failed.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~