Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/sh
res=0
IFS="
"
for f in `find . ! -type d`;
do
let " res += `wc -l $f | awk '{print $1}'` "
done
echo $res
@tsamaya
tsamaya / server.conf
Last active April 4, 2017 07:48
NGINX default server (letsencrypt)
# Default server configuration
#
server {
listen 80;
listen [::]:80;
server_name domain.net www.domain.net;
access_log /var/log/nginx/domain-http.log;
error_log /var/log/nginx/domain-error-http.log;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tsamaya
tsamaya / my-global-npm.md
Last active November 18, 2017 17:31
My npm packages globally installed
@tsamaya
tsamaya / bash_profile
Last active March 1, 2020 20:44
bash profile
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
export JAVA_HOME=$(/usr/libexec/java_home)
#export PATH="/usr/local/sbin:$PATH"
@tsamaya
tsamaya / README.md
Created January 23, 2018 10:48
Global .gitignore
touch ~/.gitignore
git config --global core.excludesfile ~/.gitignore
# Created by https://www.gitignore.io/api/osx

### OSX ###
*.DS_Store
.AppleDouble
.LSOverride

tmux cheatsheet

running tmux

start new with session name:

tmux new -s myname

attach:

tmux a # (or at, or attach)

const N = 1000000;
const STR = 'abcdefghijkl';
function simpleConcat() {
let str = '';
for (let i = 0; i < N; i++) {
str += STR;
}
return str;
}