Skip to content

Instantly share code, notes, and snippets.

@msarahan
msarahan / Conda-build rendering tour.ipynb
Last active February 14, 2020 17:28
Conda-build rendering overview
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from pyspark import SparkContext
from pyspark import SparkConf
import os
import sys
if __name__ == "__main__":
conf = SparkConf()
conf.setAppName("version-check")
@prayashm
prayashm / graph.py
Created February 5, 2018 19:09
Realtime Graphs in Bokeh
from bokeh.plotting import figure, curdoc
from bokeh.driving import linear
from impact import from_csv, reader
import random
p = figure(plot_width=1000, plot_height=600)
r1 = p.line([], [], color="firebrick", line_width=2)
r2 = p.line([], [], color="limegreen", line_width=2)
r3 = p.line([], [], color="limegreen", line_width=2)
@thomasdarimont
thomasdarimont / app.py
Last active April 24, 2024 19:42
Simple python example using flask, flask_oidc and keycloak
import json
import logging
from flask import Flask, g
from flask_oidc import OpenIDConnect
import requests
logging.basicConfig(level=logging.DEBUG)
app = Flask(__name__)
@tonykwon
tonykwon / Steps
Last active August 23, 2019 21:34
tinydns and dnscache setup on OS X
0. create users then hide dnsrun and dnslog users from the login window
$ sh create-user-group.sh
$ sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array-add dnsrun dnslog
1. Install daemontools -> http://cr.yp.to/daemontools.html
$ mkdir /package
$ cd /package
$ curl http://cr.yp.to/daemontools/daemontools-0.76.tar.gz -o daemontools-0.76.tar.gz
$ tar -xvzf daemontools-0.76.tar.gz
@mcg1969
mcg1969 / virtual_hotfixing_build_groups.md
Last active May 5, 2017 15:59
Conda hackery: virtual hotfixing via build groups

Conda proposal: virtual hotfixing via build groups

In this note, I propose a modification to conda and to its implied package specification that will provide, in my view, a solution to a common pitall of the conda ecosystem, and will provide additional performance benefits as well.

Motivation

With conda, as with many package ecosystems, it is often necessary for a package to place version constraints on its dependencies to ensure that they interoperate properly. In practice, such constraints must balance two competing concerns:

  • if the constraints are specified too tightly, then packages will often unable to coexist, because their version constraints will conflict. For example, if package A depends on B <2.0, and package C depends on B >2.0, then packages A, B, and C cannot coexist. The tighter the constraints, the more likely this is to happen.
  • on the other hand, if the constraints are specifed too loosely, then packages will often break if one of their dependencies ce
@kalefranz
kalefranz / conda-repo-clone
Last active June 24, 2021 10:28
Conda Repo Clone
#!/usr/bin/env python
import hashlib
import json
import logging
import logging.handlers
import os
import shutil
import sys
import tempfile
import urllib
@transitive-bullshit
transitive-bullshit / logger.js
Last active February 18, 2024 21:32
winston logger with filename:linenumber
// NOTE: this adds a filename and line number to winston's output
// Example output: 'info (routes/index.js:34) GET 200 /index'
var winston = require('winston')
var path = require('path')
var PROJECT_ROOT = path.join(__dirname, '..')
var logger = new winston.logger({ ... })
// this allows winston to handle output from express' morgan middleware
@kakawait
kakawait / conf.py
Last active August 4, 2022 09:35
Sphinx only plugin
import sys, os
# The path where you put the only.py file
sys.path.append(os.path.abspath('../sphinx-ext/'))
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['scope']
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active April 17, 2024 10:51
Backend Architectures Keywords and References