Skip to content

Instantly share code, notes, and snippets.

View tuttelikz's full-sized avatar
🔨
生き甲斐

San Askaruly tuttelikz

🔨
生き甲斐
View GitHub Profile
@tuttelikz
tuttelikz / activate_tf_conda.sh
Created March 27, 2018 11:39
Activate tensorflow with conda
source activate tensorflow
@tuttelikz
tuttelikz / open_explorer.sh
Created March 28, 2018 08:01
Ubuntu command to open folder or file of a current repository in GUI
The following works in all desktop environments by using the default file manager:
xdg-open .
You can also open files from the terminal as if you had double clicked them in the file manager:
xdg-open file
@tuttelikz
tuttelikz / run_sh_cmd_linux
Created April 3, 2018 08:35
Commands to run .sh on linux
Give execute permission to your script:
chmod +x /path/to/yourscript.sh
And to run your script:
/path/to/yourscript.sh
@tuttelikz
tuttelikz / relative_layout_tricks.xml
Created April 19, 2018 03:54
Properties of relative layout in android xml
// Puts to lower of another android element
android:layout_below="@id/scrollView"
// Puts to right of another element
android:layout_toRightOf="@id/timeStatLabel"
@tuttelikz
tuttelikz / csv_file_tricks_android
Created April 19, 2018 03:55
In this way you can create csv file comma delimiter
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");
@tuttelikz
tuttelikz / jsftp_test.js
Created April 19, 2018 09:20
Simple script to test library: https://github.com/sergi/jsftp
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"
@tuttelikz
tuttelikz / mongo_db_import
Created April 23, 2018 05:57
This is a gist to import json file to a mongodb collection
mongoimport --db sleepmon1 --collection sensorValues --drop --file ~/Videos/data.json --jsonArray
@tuttelikz
tuttelikz / show_collection_elements_mongo
Created April 23, 2018 06:00
Command to show data of mongodb collection
#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()
@tuttelikz
tuttelikz / choose_second_li_element
Last active April 24, 2018 06:25
a way to choose specific li element
<script>
d3.select("li:nth-child(2n)").style("color", "red"); # second
d3.select("li:nth-child(even)").style("color", "red"); # even
</script>
@tuttelikz
tuttelikz / csv2tsv
Last active April 26, 2018 06:45
Instructions on how to convert TSV to CSV file
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