Skip to content

Instantly share code, notes, and snippets.

:octocat:
Be yourself. Be now!

Sanzhar Askaruly tuttelikz

:octocat:
Be yourself. Be now!
Block or report user

Report or block tuttelikz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tuttelikz
tuttelikz / different_versions_d3
Created Apr 30, 2018
Simple gist showing how to insert d3 charts of different versions into same html page
View different_versions_d3
// First declare third version as a separate variable
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
d3version3 = d3
window.d3 = null
</script>
// Then declare fourth version as a separate variable
@tuttelikz
tuttelikz / create_duplicate_project_git
Created Apr 29, 2018
This is a gist demonstrating how you can create a duplicate of a project
View create_duplicate_project_git
In your case, I would suggest going with [submodules](https://stackoverflow.com/a/19279658/403401). However to answer your exact question, here's how you should proceed.
1. Start by creating `Jeremy/MyShooter` and `Jeremy/MyRPG` on Github. Keep them empty.
2. Clone your origin project on your system, twice, giving it different names
$ git clone http://github.com/Bob/CoolFramework MyShooter
$ git clone http://github.com/Bob/CoolFramework MyRPG
@tuttelikz
tuttelikz / create_gh-pages-branch
Created Apr 29, 2018
This is a simple procedure how one can create gh-pages branch on newly created repository
View create_gh-pages-branch
# 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
@tuttelikz
tuttelikz / edit_csv_bash
Last active Apr 30, 2018
Instructions on how to leave with only specific columns of csv file
View edit_csv_bash
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
###############################################################
@tuttelikz
tuttelikz / csv2tsv
Last active Apr 26, 2018
Instructions on how to convert TSV to CSV file
View csv2tsv
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
@tuttelikz
tuttelikz / choose_second_li_element
Last active Apr 24, 2018
a way to choose specific li element
View choose_second_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 / show_collection_elements_mongo
Created Apr 23, 2018
Command to show data of mongodb collection
View show_collection_elements_mongo
#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 / mongo_db_import
Created Apr 23, 2018
This is a gist to import json file to a mongodb collection
View mongo_db_import
mongoimport --db sleepmon1 --collection sensorValues --drop --file ~/Videos/data.json --jsonArray
View jsftp_test.js
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 / csv_file_tricks_android
Created Apr 19, 2018
In this way you can create csv file comma delimiter
View csv_file_tricks_android
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");
You can’t perform that action at this time.