Skip to content

Instantly share code, notes, and snippets.

View salman-ghauri's full-sized avatar

Salman Ghauri salman-ghauri

  • Pakistan
View GitHub Profile
@aligusnet
aligusnet / ncdc.sh
Last active December 11, 2021 19:56
Download a weather dataset from the National Climatic Data Center (NCDC, http://www .ncdc.noaa.gov/). Prepare it for examples of "Hadoop: The Definitive Guide" book by Tom White. http://www.amazon.com/Hadoop-Definitive-Guide-Tom-White/dp/1449311520 Usage: ./ncdc.sh 1901 1930 # download wheather datasets for period from 1901 to 1930.
#!/usr/bin/env bash
# global parameters
g_tmp_folder="ncdc_tmp";
g_output_folder="ncdc_data";
g_remote_host="ftp.ncdc.noaa.gov";
g_remote_path="pub/data/noaa";
@Kartones
Kartones / postgres-cheatsheet.md
Last active July 30, 2024 09:33
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@prakashjayy
prakashjayy / Tranfer_Learning_Keras_02.py
Last active September 17, 2019 17:10
Transfer Learning using Keras
from keras import applications
from keras.preprocessing.image import ImageDataGenerator
from keras import optimizers
from keras.models import Sequential, Model
from keras.layers import Dropout, Flatten, Dense, GlobalAveragePooling2D
from keras import backend as k
from keras.callbacks import ModelCheckpoint, LearningRateScheduler, TensorBoard, EarlyStopping
img_width, img_height = 256, 256
@salman-ghauri
salman-ghauri / get_birds_eye.py
Last active October 4, 2018 12:16
Download Bing Map Bird's Eye Images. (High resolution)
"""
Use this code to download High resolution Birds Eye view which is similar to Google map's 45° imagery. There is no straight
forward way to download either of these.
"""
import urllib
import json, sys
from PIL import Image
from io import BytesIO
latlon = sys.argv[1]
@GEEGABYTE1
GEEGABYTE1 / dfs.py
Created July 21, 2021 03:03
Max-Depth Solution
from tree import TreeNode
def dfs(root_node, goal, path=(), layers_lst=[], root=None):
if root == None:
root = root_node
path = path + (root_node,)
current_level_lst=[]
for i in path:
if not i.value in current_level_lst: