This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Github's web hosting looks for a branch called "gh-pages" | |
# Git by names the default branch "master" so we must rename | |
# it to "gh-pages" so that Github can find the website files. | |
# In terminal/cmd | |
############################################################# | |
mkdir YOUR_REPO.github.com | |
cd YOUR_REPO.github.com | |
echo "# hello Sanzhar" >> README.md | |
git init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Print only second and third column of a file and save with a different name: | |
############################################################### | |
awk -F, '{ print $2, $3 }' data_hr.csv > data_hr1.csv | |
############################################################### | |
Only print on terminal without 1st column of a file: | |
############################################################### | |
cut --complement -f 1 -d, data_hr.csv | |
############################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First, add to file and name it as csv2tab.sh the following script: | |
########################################################################### | |
#!/usr/bin/env python | |
import csv, sys | |
csv.writer(sys.stdout, dialect='excel-tab').writerows(csv.reader(sys.stdin)) | |
########################################################################### | |
Then, locate your terminal to the directory where you saved .sh file and give it execution permissions with: | |
########################################################################### | |
chmod +x the_file_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
d3.select("li:nth-child(2n)").style("color", "red"); # second | |
d3.select("li:nth-child(even)").style("color", "red"); # even | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Once you are in terminal/command line, access the database/collection you want to use as follows: | |
show dbs | |
use <db name> | |
show collections | |
# choose your collection and type the following to see all contents of that collection: | |
db.collectionName.find() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mongoimport --db sleepmon1 --collection sensorValues --drop --file ~/Videos/data.json --jsonArray |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const userInfo = "sanzhar" | |
const passInfo = "unist" | |
const jsftp = require("jsftp"); | |
const Ftp = new jsftp({ | |
host: "mico.knu.ac.kr", | |
port: 22, // defaults to 21 | |
user: userInfo, // defaults to "anonymous" | |
pass: passInfo // defaults to "@anonymous" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
writer.append(index_only); | |
writer.append(","); | |
writer.append(time_only); | |
writer.append(","); | |
writer.append(hr_only); | |
writer.append(","); | |
writer.append(ox_only); | |
writer.append(","); | |
writer.append(temp_only); | |
writer.append("\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Puts to lower of another android element | |
android:layout_below="@id/scrollView" | |
// Puts to right of another element | |
android:layout_toRightOf="@id/timeStatLabel" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Give execute permission to your script: | |
chmod +x /path/to/yourscript.sh | |
And to run your script: | |
/path/to/yourscript.sh |