Skip to content

Instantly share code, notes, and snippets.

@cdolek
cdolek / gist:721339e189dd3d33921d817bb955060a
Created June 3, 2017 00:26
Filter CSV by length of string in a column
# Gets line if string in the first column is longer than 6
cat file.csv | awk -F "," 'length($1)>6' > file_longerthan6chars.csv
@cdolek
cdolek / gist:b14421777b688724e942f72aec065f1c
Created June 5, 2017 22:33
getting all string after nth character
**from,to**
awk '{print substr($0,24,999999)}' my.csv
@cdolek
cdolek / gist:700f5e3cd2791297df8f271ef909b6e6
Created June 14, 2017 22:32
Get links from html file
sed -n 's/.*href="\([^"]*\).*/\1/p' *.html >> somefile.txt
@cdolek
cdolek / gist:38d7f69f5ae24144d548b798ec81e5d5
Last active June 15, 2017 19:08
Rename spaces in the files and directory names found in a directory to _ underscore
for f in *\ *; do mv "$f" "${f// /_}"; done
@cdolek
cdolek / dropbox
Created October 3, 2017 02:12 — forked from thisismitch/dropbox
/etc/init.d/dropbox
#!/bin/sh
### BEGIN INIT INFO
# Provides: dropbox
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: false
# Short-Description: dropbox service
### END INIT INFO
@cdolek
cdolek / package.json
Created November 1, 2017 02:49
Meteor eslintConfig
"eslintConfig": {
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"plugins": ["meteor", "react"],
"extends": [
"airbnb",
"plugin:meteor/recommended",
@cdolek
cdolek / gensim_ldamulticore_error.txt
Last active December 22, 2017 12:23
Python v3.6.4 - LdaMulticore crash
lda = LdaMulticore(trigram_bow_corpus,
num_topics=num_topics,
workers=2,
id2word=trigram_dictionary,
chunksize=10000,
passes=passes)
----------------------------------------------------------------------------------------------------------------------------
2017-12-22 07:17:25,366 : INFO : loading Dictionary object from ./data/data_output/trigram_dict_all.dict
@cdolek
cdolek / gist:244aabc843cefb3517c28e70d1fa8c12
Last active April 10, 2018 15:50
replacing value of a column in a csv file
# Here we replace col 4 with the value of 1
awk -F, '{$4="1";}1' OFS=, my.csv
@cdolek
cdolek / gist:3b092e1559409a87e6e84bb50ad11bf1
Created June 30, 2018 22:53
Meteor multiple functions & future(s) result
const range = [
future => {
Meteor.setTimeout(() => {
future.return(1000);
}, 1000);
},
future => {
Meteor.setTimeout(() => {
future.return(2000);
}, 2000);

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by