Skip to content

Instantly share code, notes, and snippets.

View abdulhalim-cu's full-sized avatar

Abdul Halim abdulhalim-cu

  • Brain Station 23 Ltd
  • Dhaka
View GitHub Profile
@abdulhalim-cu
abdulhalim-cu / git-ssh-error-fix.sh
Created June 4, 2021 18:10 — forked from Tamal/git-ssh-error-fix.sh
Solution for 'ssh: connect to host github.com port 22: Connection timed out' error
$ git clone git@github.com:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
$ # This should also timeout
$ ssh -T git@github.com
ssh: connect to host github.com port 22: Connection timed out
$ # but this might work
#go to your home directory and get the golang tarball using curl
cd ~
#change "go1.16.3" to whatever version you want
curl -O https://dl.google.com/go/go1.16.3.linux-amd64.tar.gz
#extract the download using tar and move to /user/local
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.16.3.linux-amd64.tar.gz
#set up your go paths
sudo nano ~/.bashrc
"""""""""""""""""""""""""""""""""""
"""""" bizzped.py """""""""""""""""
import bz2
import sys
opener = bz2.open
if __name__ == "__main__":
import os
for folderName, subfolders, filenames in os.walk('C:\\delicious'):
print('The current folder is ' + folderName)
for subfolder in subfolders:
print('SUBFOLDER OF ' + folderName + ': ' + subfolder)
for filename in filenames:
print('FILE INSIDE ' + folderName + ': '+ filename)
@abdulhalim-cu
abdulhalim-cu / filter-array.js
Last active November 10, 2017 09:36
To find the people in the ancestry data set who were young in 1924, the following function might be helpful. It filters out the elements in an array that don’t pass a test.
// ancestry = http://eloquentjavascript.net/code/ancestry.js
function filter(array, test) {
var passed = [];
for (var i = 0; i < array.length; i++) {
if (test(array[i]))
passed.push(array[i]);
}
return passed;
}
function deepEqual(a, b) {
if (a === b) return true;
if (a == null || typeof a != "object" ||
b == null || typeof b != "object")
return false;
var propsInA = 0, propsInB = 0;
for (var prop in a)
####################################
# SET UP NUMIX ON DEBIAN WITH XFCE #
####################################
# | THIS SCRIPT IS TESTED CORRECTLY ON |
# |------------------------------------|
# | OS | Test | Last test |
# |----------------|------|------------|
# | Debian 9.1 | OK | 4 Sep 2017 |
# Script that installs additional graphical user interface (GUI) software for Ubuntu/Debian
# Keep Ubuntu or Debian up to date
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo apt-get -y autoremove
# Development tools:
sudo apt-get install -y gdebi
# Script that installs additional command-line interface (CLI) software for Ubuntu/Debian
# Keep Ubuntu or Debian up to date
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo apt-get -y autoremove
# Development tools:
sudo apt-get install -y build-essential cmake
@abdulhalim-cu
abdulhalim-cu / arraytolist_and_listtoarray.js
Created November 4, 2017 13:45
Write a function arrayToList that builds up a data structure like the previous one when given [1, 2, 3] as argument, and write a listToArray function that produces an array from a list. Also write the helper functions prepend, which takes an element and a list and creates a new list that adds the element to the front of the input list, and nth, …
function arrayToList(array) {
var list=null;
for (var i=array.length - 1; i >= 0; i--) {
list = {value:array[i], rest:list};
}
return list;
}
function listToArray(list){
var array = [];