Skip to content

Instantly share code, notes, and snippets.

We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
const fs = reqiure("fs");
(async () => {
let files = [];
let lineCount = 0;
const directoryPath = ".";
const fileType = "csv";
try {
const fileNames = fs.readdirSync(directoryPath);
import fs from "fs";
(async () => {
let files = [];
let lineCount = 0;
const directoryPath = ".";
const fileType = "csv";
try {
const fileNames = fs.readdirSync(directoryPath);
@muratcakmak
muratcakmak / setup.sh
Last active March 18, 2022 20:43
New Mac Setup Script Raw
#!/bin/sh
# ___ __ __ ____ _ ____ _
# / _ \| \/ |/ ___( )___ / ___| ___| |_ _ _ _ __
# | | | | |\/| | | |// __| \___ \ / _ \ __| | | | '_ \
# | |_| | | | | |___ \__ \ ___) | __/ |_| |_| | |_) |
# \___/|_| |_|\____| |___/ |____/ \___|\__|\__,_| .__/
# |_|
echo "Creating an SSH key for you..."
@muratcakmak
muratcakmak / binarySearch.swift
Last active November 13, 2017 22:13
Binary Search implementation in Swift
func binarySearch<T: Comparable> (on array: [T], target: T) -> Int?{
if(array.count <= 1 && array.first != target){
return nil
}
let middle = array.count/2
if(target == array[middle]){
return middle
}else if(target < array[middle]){
return binarySearch(on: Array(array.dropLast(middle)), target: target)
@muratcakmak
muratcakmak / git.migrate
Created September 14, 2017 00:44 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.