Skip to content

Instantly share code, notes, and snippets.

View woss's full-sized avatar
🛸

Daniel Maricic woss

🛸
View GitHub Profile
@woss
woss / Exif-questdb-schema.sql
Created January 11, 2024 14:40 — forked from javier/Exif-questdb-schema.sql
Exif-questdb-schema
CREATE TABLE CameraDetails (
Manufacturer SYMBOL,
Model SYMBOL,
Orientation SYMBOL,
Software STRING,
DateAndTime timestamp,
YCbCrPositioning SYMBOL,
Compression SYMBOL,
XResolution LONG,
YResolution LONG,
@woss
woss / Dockerfile
Created March 22, 2022 12:05 — forked from pepyakin/Dockerfile
Substrate Raspberry PI cross-compile build
# Put this file in the root of substrate / polkadot directory and build the image using
# the following command:
#
# docker build -t <container id> .
#
# you can pick <container id> yourself. For example: `johndoe/rpi-cross`.
#
FROM rust:latest
@woss
woss / Object Flatten
Created October 5, 2019 18:02 — forked from penguinboy/Object Flatten
Flatten javascript objects into a single-depth object
var flattenObject = function(ob) {
var toReturn = {};
for (var i in ob) {
if (!ob.hasOwnProperty(i)) continue;
if ((typeof ob[i]) == 'object') {
var flatObject = flattenObject(ob[i]);
for (var x in flatObject) {
if (!flatObject.hasOwnProperty(x)) continue;
@woss
woss / Object Flatten
Created October 5, 2019 18:02 — forked from penguinboy/Object Flatten
Flatten javascript objects into a single-depth object
var flattenObject = function(ob) {
var toReturn = {};
for (var i in ob) {
if (!ob.hasOwnProperty(i)) continue;
if ((typeof ob[i]) == 'object') {
var flatObject = flattenObject(ob[i]);
for (var x in flatObject) {
if (!flatObject.hasOwnProperty(x)) continue;
@woss
woss / apollo-fetch.js
Created September 17, 2018 16:32 — forked from stubailo/apollo-fetch.js
Call a GraphQL API with apollo-fetch
const { createApolloFetch } = require('apollo-fetch');
const fetch = createApolloFetch({
uri: 'https://1jzxrj179.lp.gql.zone/graphql',
});
fetch({
query: '{ posts { title }}',
}).then(res => {
console.log(res.data);
@woss
woss / bitcolor.js
Created December 17, 2017 17:48 — forked from lrvick/bitcolor.js
Javascript functions for doing fast binary/hex/RGB color conversions using bitwise operations.
// convert 0..255 R,G,B values to binary string
RGBToBin = function(r,g,b){
var bin = r << 16 | g << 8 | b;
return (function(h){
return new Array(25-h.length).join("0")+h
})(bin.toString(2))
}
// convert 0..255 R,G,B values to a hexidecimal color string
RGBToHex = function(r,g,b){
@woss
woss / .block
Last active May 25, 2017 11:21 — forked from mbostock/.block
Force-Directed Tree
license: gpl-3.0
@woss
woss / sort_requirements.py
Created February 15, 2017 18:24 — forked from michaelBenin/sort_requirements.py
Sort requirements pip files or requirements.txt for python dependencies
requirements_file = 'base.pip'
requirements = open(requirements_file, 'r')
content = requirements.read().splitlines()
content = list(set(content))
content.sort(key=lambda y: y.lower())
content = '\n'.join(content)
file = open('sorted_'+requirements_file, 'w')
file.write(content)
@woss
woss / sort_requirements.py
Created February 15, 2017 18:24 — forked from michaelBenin/sort_requirements.py
Sort requirements pip files or requirements.txt for python dependencies
requirements_file = 'base.pip'
requirements = open(requirements_file, 'r')
content = requirements.read().splitlines()
content = list(set(content))
content.sort(key=lambda y: y.lower())
content = '\n'.join(content)
file = open('sorted_'+requirements_file, 'w')
file.write(content)
@woss
woss / dropzone-directive.js
Created December 31, 2015 11:05 — forked from compact/dropzone-directive.js
AngularJS directive for Dropzone.js
/**
* An AngularJS directive for Dropzone.js, http://www.dropzonejs.com/
*
* Usage:
*
* <div ng-app="app" ng-controller="SomeCtrl">
* <button dropzone="dropzoneConfig">
* Drag and drop files here or click to upload
* </button>
* </div>