Skip to content

Instantly share code, notes, and snippets.

View ilyakamens's full-sized avatar

Ilya Kamens ilyakamens

View GitHub Profile
@markddavidoff
markddavidoff / slack-pagerduty-oncall.py
Last active April 19, 2024 02:41
Updates a Slack User Group with People that are on call in PagerDuty (updated for pagerduty v2 api and pull from env vars instead of KMS). Based on:https://gist.github.com/devdazed/473ab227c323fb01838f
"""
Lambda Func to update slack usergroup based on pagerduty rotation
From: https://gist.github.com/devdazed/473ab227c323fb01838f
NOTE: If you get a permission denied while setting the usergroup it is because there’s a workspace preference in slack
that limits who can manage user groups. At the time of writing it was restricted to owners and admins so i had to get
an owner to install the app. First i added them as a collaborator and then had them re-install the app, and got the new
auth token and added that to param store.
@ilyakamens
ilyakamens / trie-autocomplete.py
Created November 17, 2015 02:22 — forked from quiver/trie-autocomplete.py
trie-based autocomplete using redis/python
# vim: set fileencoding=utf8
'''
References
- http://stackoverflow.com/a/1966188
- http://en.wikipedia.org/wiki/Tree_(data_structure)
$ python suggest.py prefix
'''
import sys
import redis
@paulirish
paulirish / what-forces-layout.md
Last active July 22, 2024 06:32
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent

There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.

All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.

  1. Loop variables are scoped outside the loop.

What do these lines do? Make predictions and then scroll down.

func print(pi *int) { fmt.Println(*pi) }
@miku
miku / README.md
Last active July 14, 2022 17:21
git --track vs --set-upstream vs --set-upstream-to

README

Short excursion into git --track, --set-upstream and --set-upstream-to.

All examples use the aliases co for checkout and br for branch.

Setup:

$ git clone git@github.com:AKSW/OntoWiki.git

#!/usr/bin/python
import subprocess
import sys
"""
Used in a tmux session, connects a synchronized interactive ssh session to all
hostnames read from stdin (1 per line). Preserves all ssh arguments.
Example usage:
tmux
@quiver
quiver / trie-autocomplete.py
Created April 4, 2013 15:47
trie-based autocomplete using redis/python
# vim: set fileencoding=utf8
'''
References
- http://stackoverflow.com/a/1966188
- http://en.wikipedia.org/wiki/Tree_(data_structure)
$ python suggest.py prefix
'''
import sys
import redis
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active July 17, 2024 14:20
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: