Skip to content

Instantly share code, notes, and snippets.

View ylogx's full-sized avatar
🤘
<div><ståtús/></div>

Shubham Chaudhary ylogx

🤘
<div><ståtús/></div>
View GitHub Profile
@ylogx
ylogx / perf_bytes_io.py
Created November 13, 2018 09:55
Performance Analysis of Bytes IO vs File IO
"""
Usage:
>>> ipython
>>> %load perf_bytes_io.py
>>> <ENTER>
"""
import logging
import tempfile
import cv2

Keybase proof

I hereby claim:

  • I am ylogx on github.
  • I am chaudhary (https://keybase.io/chaudhary) on keybase.
  • I have a public key ASD1Ch1-5EWG9Sr7RwFNaIGhe-WSVzAlJLv_FNHByL0c2Ao

To claim this, I am signing this object:

@ylogx
ylogx / xgboost_incremental.ipynb
Last active February 16, 2024 14:25
XGBoost Incremental Learning
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am shubhamchaudhary on github.
  • I am chaudhary (https://keybase.io/chaudhary) on keybase.
  • I have a public key whose fingerprint is FBD2 1E51 18DF 1B4C 2F18 82B1 71B6 881F FAB5 2DCA

To claim this, I am signing this object:

@ylogx
ylogx / zomato_bookmarklet.js
Last active September 26, 2018 06:24
A bookmarklet to find various zomato resource properties. To use, copy this code and paste it in URL field of a new bookmark.
javascript: void
function($) {
var loadBookmarklet = function($) {
(function() {
if ("www.zomato.com" == document.domain) {
var msg = "";
try {
splits = $('meta[property="al:android:url"]').attr("content").split("/");
const id = splits[3],
page_type = splits[2];
@ylogx
ylogx / load_and_cache.py
Created July 21, 2016 12:56
Load a dataset and cache it for further calls
import numpy as np
import pickle
def load_and_cache(filename):
output = None
cache_dir = '/tmp/my_project_cache/'
os.makedirs(cache_dir, mode=0o744, exist_ok=True)
cache = cache_dir + filename + '.pkl'
if not os.path.exists(cache):
output = np.genfromtxt(filename, dtype=float, delimiter=',') # TODO: Fill your logic
package com.peplet.hulkdownloader.app.background.utils;
import android.content.Context;
import android.content.SharedPreferences;
import android.provider.Settings.Secure;
import android.support.annotation.NonNull;
import android.telephony.TelephonyManager;
import java.io.UnsupportedEncodingException;
import java.util.UUID;
@ylogx
ylogx / build.gradle
Created March 21, 2016 12:02
Fancy Print test results with gradle
tasks.withType(Test) {
testLogging {
// set options for log level LIFECYCLE
events "passed", "skipped", "failed", "standardOut"
showExceptions true
exceptionFormat "short"
showCauses true
showStackTraces true
@ylogx
ylogx / build-and-run.sh
Last active March 2, 2020 20:32
Build Script for doing Android Studio 'run' equivalent from command line
#!/usr/bin/env bash
PACKAGE=com.example.demo
ACTIVITY=.MainActivity
APK_LOCATION=app/build/outputs/apk/app-debug.apk
echo "Package: $PACKAGE"
echo "Building the project with tasks: $TASKS"
./gradlew $TASKS
@ylogx
ylogx / Makefile
Last active August 29, 2015 14:14
A makefile to compile all source code in a given folder
#########################################################################
#
# Makefile - This Makefile compiles all c files in given folder
# Copyright (c) 2014-2015 Shubham Chaudhary <me@shubhamchaudhary.in>
#
#########################################################################
#SPECIFIED_SRC_FILE = $(foreach d,$(SPECIFIED_SRC_DIRS),$(wildcard $(addprefix $(d)/*,*.c)))
#CC = gcc