Skip to content

Instantly share code, notes, and snippets.

View danield137's full-sized avatar

Daniel Dror (Dubovski) danield137

View GitHub Profile
@danield137
danield137 / channels_example.go
Last active March 7, 2017 07:50
Basic channels example in go
package main
import (
"fmt"
"time"
)
func main() {
t := NewTest()
// call methods on separate goroutines
@danield137
danield137 / pipes_example.go
Created March 7, 2017 10:14
amature pipes in go
package main
import (
"fmt"
"time"
)
func main() {
raw := NewRawPipe()
agg := NewAggregatedPipe(raw.out)
@danield137
danield137 / Cytoscape.jsx
Created August 7, 2017 17:04
cytoscape react component
import React, { Component } from 'react';
import cytoscape from 'cytoscape';
import cydagre from 'cytoscape-dagre';
cydagre(cytoscape);
let cyStyle = {
height: '400px',
display: 'block'
};
@danield137
danield137 / .zshrc
Last active December 17, 2017 12:35
zsh_profile
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/danieldubovski/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"
@danield137
danield137 / ecs_utils.py
Last active September 28, 2019 15:35
manage_ecs_services
import boto3
import json
def dump_task_conatiner_defs(
output_path='services.',
cluster_filter=lambda c_arn: True,
service_filter=lambda s_arn: True,
task_filter=lambda t_arn: True):
"""
@danield137
danield137 / main.py
Last active January 30, 2018 09:55
Python Rabbit Utils
#!/usr/local/bin python3
import json
import pika
def dump_queue_to_file(broker, queue):
if not broker:
raise ValueError('please set the broker url.')
@danield137
danield137 / crawl_send_eventhub.py
Last active January 20, 2023 05:35
Kusto Github Demo
from pprint import pprint
import requests
import json
import os
import sys
import time
import datetime
import traceback
from azure.eventhub import EventHubClient, Sender, EventData, EventHubError
import logging
@danield137
danield137 / EventGridProgram.cs
Created April 16, 2019 13:04
Log Azure Storage Event Via Event Grid Subscription
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Azure.EventGrid;
using Microsoft.Azure.EventHubs.Processor;
using Newtonsoft.Json;
using CloseReason = Microsoft.Azure.EventHubs.Processor.CloseReason;
@danield137
danield137 / head_folder.py
Last active May 6, 2019 10:07
Copy first lines of every file in folder
import os
extension = '.csv'
files = [f for f in os.listdir() if f.endswith(extension)]
target_dir = 'samples'
lines_to_copy = 1000
os.mkdir(target_dir)
@danield137
danield137 / partialJson.ts
Created July 9, 2019 06:58
Javascript partial json parsing
import Clarinet from 'clarinet';
class TrackingObject {
data: { [key: string]: any } | null = null;
path: string = '';
depth: number = 0;
stack: StackItem[] = [];
expandArray(key: string) {
this.stack.push({ type: 'Array', key, value: null });