Skip to content

Instantly share code, notes, and snippets.

View mcvarer's full-sized avatar
🎯
Focusing

M.C.V mcvarer

🎯
Focusing
  • Istanbul/Turkey
View GitHub Profile
@resultakak
resultakak / clean.sh
Created February 26, 2022 19:06 — forked from Iman/clean.sh
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
@zhaoweizhong
zhaoweizhong / tt100k2021_to_coco.py
Last active November 3, 2021 08:51
Transform Tsinghua-Tencent 100K Dataset (ver 2021) Annotations to COCO Format
import json
import argparse
import copy
def load_json(file_name):
file = open(file_name, 'r').read()
return json.loads(file)
@MittalShruti
MittalShruti / install.sh
Created May 9, 2020 12:21
Install CUDA 10.0 cuDNN 7.6.5 Ubuntu 16.04
#Get PPA repo drivers and Install CUDA 10.0
curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_10.0.130-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1604_10.0.130-1_amd64.deb
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda-10-0 cuda-drivers -y
#Install cuda-compatibility 10.0
sudo nvidia-smi -pm 1
sudo apt-get install cuda-compat-10.0
@berkorbay
berkorbay / ibb_open_data_ispark_query.R
Created January 19, 2020 13:51
İBB Açık Veri APIsini kullanarak İSPARK lokasyonlarını bir data frame'e indirip tibble'a dönüştürme kodu
## Paketler yüklü değilse install.packages kullanın
## install.packages(c("tidyverse","jsonlite"),repos="https://cran.r-project.org")
library(tidyverse)
library(jsonlite)
ispark_query_url <- "https://data.ibb.gov.tr/api/3/action/datastore_search_sql?sql=SELECT%20*%20from%20%22c3eb0d72-1ce4-4983-a3a8-6b0b4b19fcb9%22"
raw_value <- fromJSON(ispark_query_url)
raw_df <- raw_value$result$records %>% rename_all(~gsub("^_","",.)) %>% rename_all(~gsub(" |\\(|\\)|/","_",.)) %>% tbl_df()
@pyRobShrk
pyRobShrk / geoid.py
Last active November 14, 2022 22:40
Python classes to calculate geoid height in meters NAVD 88 (Geoid 12b) and EGM 96
import numpy as np
from scipy.interpolate import RectBivariateSpline as Spline
import pygeodesy as geo
from pygeodesy.ellipsoidalVincenty import LatLon
class Geoid12B(): #NAD 83 Ellipsoid
# https://www.ngs.noaa.gov/GEOID/GEOID12B/GEOID12B_CONUS.shtml
# Download a Geoid Grid in little endian binary format ('g2012bu5.bin')
def __init__(self, leBinFile):
glamn, glomn, dla, dlo = np.fromfile(leBinFile,'<f8',4)
import os
import datetime
import numpy as np
os.environ['KERAS_BACKEND'] = 'theano'
os.environ['THEANO_FLAGS'] = \
'mode=FAST_RUN,device=cuda0,floatX=float32,optimizer=None'
import keras as ks
@liulixiang1988
liulixiang1988 / app.py
Created August 14, 2015 03:02
upload multiple files in Flask
import os
# We'll render HTML templates and access data sent by POST
# using the request object from flask. Redirect and url_for
# will be used to redirect the user once the upload is done
# and send_from_directory will help us to send/show on the
# browser the file that the user just uploaded
from flask import Flask, render_template, request, redirect, url_for, send_from_directory
from werkzeug import secure_filename
# Initialize the Flask application
@AmitThakur
AmitThakur / opencv_install.md
Last active March 13, 2024 05:08
How to install OpenCV on LInux (Ubuntu)
class DotDict(dict):
"""dict class that allows you to access values by dot notation"""
def __init__(self,arg):
for k in arg.keys():
if (type(arg[k]) is dict):
self[k]=DotDict(arg[k])
else:
self[k]=arg[k]
def __getattr__(self, attr):