Skip to content

Instantly share code, notes, and snippets.

View bhoomit's full-sized avatar

Bhoomit bhoomit

  • Goibibo & MakeMyTrip
  • Bangalore
View GitHub Profile
@bhoomit
bhoomit / gist:d15537dab562cda06df3a6a066c6dddd
Created March 12, 2020 07:45
Docker + RHEL + FreeRADIUS
$ docker login registry.redhat.io
Username: ${REGISTRY-SERVICE-ACCOUNT-USERNAME}
Password: ${REGISTRY-SERVICE-ACCOUNT-PASSWORD}
Login Succeeded!
$ docker pull registry.redhat.io/rhel7
----------
Centos 7 Dockerimage with chanhed "FROM registry.redhat.io/rhel7" should work here
@bhoomit
bhoomit / preact-alias.js
Last active December 12, 2017 09:41
Preact Alias
window.ReactDOM = preactCompat;
window.React = preactCompat;
console.log('loaded')
@bhoomit
bhoomit / zlib_perm_link_tensorflow.patch
Last active January 12, 2017 09:58
zlib_perm_link_tensorflow
# Use with this Dockerfile https://github.com/johndpope/DockerParseyMcParsefaceAPI
# https://github.com/dsindex/syntaxnet/blob/master/README_api.md
cd /
git clone https://github.com/dsindex/syntaxnet.git work
cd work
git clone --recurse-submodules https://github.com/tensorflow/serving
# checkout proper version of serving
cd serving
@bhoomit
bhoomit / UIButton+Animation.m
Last active August 29, 2015 14:08
UIButton bounce animation
/* #define taken from http://ios-blog.co.uk/tutorials/cleaner-properties-implementation-in-categories/ */
/* generic applicable to all objects and primitive types */
#define JESynthesize(ownership, type, getter, setter) \
static const void *_JESynthesizeKey_##getter = &_JESynthesizeKey_##getter; \
- (type)getter \
{ \
return _JESynthesize_get_##ownership(type, getter); \
@bhoomit
bhoomit / hex2hsl
Last active November 9, 2018 10:35
function rgbToHsl(r, g, b){
r /= 255, g /= 255, b /= 255;
var max = Math.max(r, g, b), min = Math.min(r, g, b);
var h, s, l = (max + min) / 2;
if(max == min){
h = s = 0; // achromatic
}else{
var d = max - min;
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
@bhoomit
bhoomit / app.py
Last active December 21, 2015 04:19
import os
from flask import Flask, redirect, request, current_app, jsonify
app = Flask(__name__)
@app.route('/', methods=['GET','POST'])
def hello():
return "Hello World"
@bhoomit
bhoomit / heroku-fork-help
Last active December 14, 2015 12:49
To use Heroku-fork plugin
#for more info
#https://github.com/ddollar/heroku-fork
heroku plugins:install https://github.com/ddollar/heroku-fork
heroku labs:enable pipelines
heroku fork -a example-source example-destination