Skip to content

Instantly share code, notes, and snippets.

View loleg's full-sized avatar

Oleg Lavrovsky loleg

View GitHub Profile
@jiffyclub
jiffyclub / conda.fish
Last active December 8, 2021 08:46
Activate and deactivate commands for working with conda environments in the fish shell. Currently assumes you are switching to a named environment, not specifying a directory.
function condalist -d 'List conda environments.'
for dir in (ls $HOME/miniconda3/envs)
echo $dir
end
end
function condactivate -d 'Activate a conda environment' -a cenv
if test -z $cenv
echo 'Usage: condactivate <env name>'
return 1
@karavanis
karavanis / commit-msg
Last active August 29, 2015 13:57 — forked from codesnik/commit-msg
#!/usr/bin/env ruby
#
# Git commit-msg hook. If your branch name is in the form "SYSRAP-123", automatically
# adds "Refs #SYSRAP-123." to commit messages unless they mention "#SYSRAP-123" already.
#
# By Henrik Nyh <http://henrik.nyh.se> 2009-09-10 under the MIT License.
#
#
# Install:
#
@madjar
madjar / scrapper.py
Last active March 5, 2023 15:02
A example of scrapper using asyncio and aiohttp
import asyncio
import aiohttp
import bs4
import tqdm
@asyncio.coroutine
def get(*args, **kwargs):
response = yield from aiohttp.request('GET', *args, **kwargs)
return (yield from response.read_and_close(decode=True))
# Demo:
#
# Aggregate population per independence type for every year
# Sources: Population and Country Codes datasets
#
from bubbles import Pipeline
# List of stores with datasets. In this example we are using the "datapackage"
# store
@marksteve
marksteve / pelican_deployer.py
Last active January 25, 2019 23:51
Push-to-deploy static sites with Pelican, Flask and Github
"""
Simple web server that listens for Github webhooks to implement push-to-deploy
with Pelican static sites
Settings are loaded from a json file except for SECRET which should be an
environment variable
Example `deployer.json`
{
@debasishg
debasishg / gist:8172796
Last active March 15, 2024 15:05
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&amp;rep=rep1&amp;t
@mef
mef / pre-render.js
Last active May 20, 2022 16:56
proof-of-concept pre-rendering d3.js svgs on the server using node.js and jsdom module.
// pre-render d3 charts at server side
var d3 = require('d3')
, jsdom = require('jsdom')
, fs = require('fs')
, htmlStub = '<html><head></head><body><div id="dataviz-container"></div><script src="js/d3.v3.min.js"></script></body></html>'
jsdom.env({
features : { QuerySelector : true }
, html : htmlStub
, done : function(errors, window) {
@d3m3vilurr
d3m3vilurr / feedly_api.md
Last active March 30, 2024 08:21
Unofficial Feedly API Document

IDs

  • user_id - user/:uid
  • feed_id - feed/:feed_uri
  • category_id - :user_id/category/:category (special category: global.all, global.uncategorized)
  • tag_id - :user_id/tag/:tag (special tag: global.saved)

APIs

http://cloud.feedly.com/:version/:api

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2024 06:36
A badass list of frontend development resources I collected over time.
@audreyt
audreyt / posa.mkdn
Last active October 12, 2021 01:06
EtherCalc Chapter for the upcoming book "The Performance of Open Source Applications" - Draft - comments welcome!

From SocialCalc to EtherCalc

Previously, in The Architecture of Open Source Applications, I described SocialCalc, an in-browser spreadsheet system that replaced the server-centric WikiCalc architecture. SocialCalc performs all of its computations in the browser; it uses the server only for loading and saving spreadsheets.

For the Socialtext team, performance was the primary goal behind SocialCalc's design in 2006. The key observation was this: Client-side computation in JavaScript, while an order of magnitude slower than server-side computation in Perl, was still much faster than the network latency incurred during AJAX roundtrips:


WikiCalc and SocialCalc's performance model

******