Skip to content

Instantly share code, notes, and snippets.

View raghavmittal101's full-sized avatar

Raghav Mittal raghavmittal101

View GitHub Profile
import numpy as np
import bpy
import math
import mathutils
base_dir = "/Users/raghavmittal101/Documents/tcs/blenderNerf/"
def getDepthMap(filename):
z = bpy.data.images['Viewer Node']
w, h = z.size
@raghavmittal101
raghavmittal101 / getRepoContributors.js
Created October 27, 2017 12:27
Get list of contributors to a repo in a given time frame
/*
options = {
"since" : {
"date" : "yyyy-mm-dd",
"time" : "hh:mm:ss"
},
"until" : {
"date" : "yyyy-mm-dd",
"time" : "hh:mm:ss"
}
function getElementByXpath(src_xpath){
var ele = document.evaluate(src_xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
return ele;
}
function replaceNode(new_html, src_xpath){
var elem = getElementByXpath(src_xpath);
elem.outerHTML = new_html;
}
function rel_to_abs(url){
/* Only accept commonly trusted protocols:
* Only data-image URLs are accepted, Exotic flavours (escaped slash,
* html-entitied characters) are not supported to keep the function fast */
if(/^(https?|file|ftps?|mailto|javascript|data:image\/[^;]{2,9};):/i.test(url))
return url; //Url is already absolute
var base_url = location.href.match(/^(.+)\/?(?:#.+)?$/)[0]+"/";
if(url.substring(0,2) == "//")
return location.protocol + url;
<!DOCTYPE html>
<html>
<style>
#floater-box, #button-box, #form, #posts{
border: 1px black solid;
padding: 10px;
width: 100hh;
}
#button-box > ul {