Skip to content

Instantly share code, notes, and snippets.

View Glavin001's full-sized avatar
💻
Working - I may be slow to respond.

Glavin Wiechert Glavin001

💻
Working - I may be slow to respond.
View GitHub Profile
@dnozay
dnozay / main.py
Created November 1, 2014 23:53
python multi-processing example using initializer function.
#!/usr/bin/env python
# This example shows how to use multiprocessing with an initializer function.
# We take advantage of that to make the workers each have a custom initial
# load. And in particular example, we will make the workers sleep.
# Because we make them sleep different amounts, one of them is going to be
# ready much before the others, and thus we can guess easily which worker
# will do most of the work.
#
# see https://stackoverflow.com/questions/26693797/python-multiprocessing-process-number
@dtinth
dtinth / README.md
Last active September 29, 2024 23:08
Batch File Rename Script

Batch File Rename

Use JavaScript for Automation to rename files in batch!

Motivation

@samdjohnson
samdjohnson / Time Series Aggregation with TempoIQ
Created October 15, 2014 16:09
An example of TempoIQ's aggregate function with the python SDK.
session = get_session('tempo-iq-backend-url', key, secret)
start_time = datetime.datetime(2014,1,1,0,0,0,0)
end_time = datetime.datetime(2014,1,2,0,0,0,0)
results = session.query(Device)
.filter(Device[‘building’] == 1)
.filter(Sensor.key == “temp”)
.interpolate(“linear”, “PT15M”)
.aggregate(“avg”)
@LizardLeliel
LizardLeliel / Quine.cpp
Created October 14, 2014 17:48
A program that outputs its source code. The logic in this file is my own design; I didn't strictly follow code conventions for this exercise, hence the function named function.
#include <iostream>
#include <string>
using namespace std;
void function(string var, int flag);
int main(){
function(R"!(
#include <iostream>
@kristianmandrup
kristianmandrup / Converting libraries to Ember CLI addons.md
Last active March 12, 2025 04:26
Guide to Developing Addons and Blueprints for Ember CLI

Converting libraries to Ember CLI addons

In this guide we will cover two main cases:

  • Ember specific library
  • vendor library

Ember library

The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.

@ikwattro
ikwattro / GithubEventAnalysisWithNeo4j.markdown
Last active December 2, 2022 17:49
Github Events Analysis with Neo4j

Github Events Analysis with Neo4j

Imgur

On July 22, Github announced the 3rd Annual Github Data Challenge presenting multiple sources of data available.

This sounded to me a good opportunity to use their available data and import it in Neo4j in order to have a lot of fun at analyzing the data that fits naturally in a graph.

As I work mainly offline or behind military proxies that do not permit me to use the ReST API, I decided to go for the Github Archive available here, you can then download json files representing Github Events on a daily/hour basis.

@Holzhaus
Holzhaus / phrase_matcher.py
Last active August 29, 2015 14:05
A working phrase matching example
import itertools
import string
import re
class PhraseMatcher(object):
ACTIONS = []
WORDS = {}
@classmethod
def get_possible_phrases(cls):
# Sample implementation, there might be a better one
@correia
correia / swift-kvo-example.swift
Last active April 16, 2023 02:38
A quick example for how to use Foundation style KVO from Swift. (Official documentation from Apple is forthcoming.)
//
// Swift-KVO
//
// Created by Jim Correia on 6/5/14.
// Copyright (c) 2014-2015 Jim Correia. All rights reserved.
//
// Update: 6/17/2014
//
// KVOContext has gone away; use the same idiom you'd use from Objective-C for the context
//
@sathomas
sathomas / README.md
Last active July 13, 2018 07:43
Understanding D3.js Force Layout - 5: charge

This is part of a series of examples that describe the basic operation of the D3.js force layout. Eventually they may end up in a blog post that wraps everything together. If you missed the beginning of the series, here's a link to first example.

The previous example shows how linkDistance tells the force layout the desired distance between connected nodes. It may seem strange that D3 doesn't simply compel all links to be that distance. The force layout, however, takes

@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 7, 2025 05:43
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\