Skip to content

Instantly share code, notes, and snippets.

View anthony-sarkis's full-sized avatar

Anthony Sarkis anthony-sarkis

View GitHub Profile
@anthony-sarkis
anthony-sarkis / import_example.py
Created January 14, 2022 03:06
diffgram import from SDK
from diffgram import Project
import time
project = Project(
host = "https://diffgram.com", # replace with your host for private installs
project_string_id = "replace_with_project_string",
client_id = "replace_with_client_id",
client_secret = "replace_with_client_secret")
signed_url_list = ["https://files.readme.io/e3d7e86-small-diffgram_logo_word_only.png" for i in range(100)]
@anthony-sarkis
anthony-sarkis / douglasPeucker.js
Created March 9, 2021 20:06 — forked from adammiller/douglasPeucker.js
Javascript implementation of the Douglas Peucker path simplification algorithm
var simplifyPath = function( points, tolerance ) {
// helper classes
var Vector = function( x, y ) {
this.x = x;
this.y = y;
};
var Line = function( p1, p2 ) {
this.p1 = p1;
@anthony-sarkis
anthony-sarkis / Defaults.py
Last active November 13, 2019 20:59
Defaults Proof of Concept (Rough)
class Test_Defaults:
def default_factory(self, x=None, type=None):
if x is None:
return self.default_by_type(type)
else:
return x
def default_by_type(self, type):
@anthony-sarkis
anthony-sarkis / class_init_comparison.py
Created November 13, 2019 20:15
Comparing python init
class Test:
def __init__(self, x=[]):
self.x = x
a = Test()
b = Test()
a.x.append(1)
print(a == b) # False