Skip to content

Instantly share code, notes, and snippets.

@cmdoptesc
cmdoptesc / change_screenshots_path.md
Created February 1, 2018 15:06
Change macOS / OSX screenshots location

defaults write com.apple.screencapture location ~/Desktop/screenshots

killall SystemUIServer

@cmdoptesc
cmdoptesc / Readme.md
Last active February 12, 2018 16:51
JavaScript D3: Arc tween transitions using attrTween and attr methods

D3: Arcs Tweening Animation

view on bl.ocks.org

Click on the grey circles. The green arcs will transition using attr, whereas the red ones will use the attrTween method.

If you have not seen/read Bostock's arc tween example, it's probably the best place to start. Secondly, I've posted up a basic example of drawing static, concentric arcs (gist), which might be helpful before adding on tweens/animations.

Below is some annotated source code from my experience playing with arcs. The biggest issue I came across was understanding the role of the arcTween helper function in relation to attrTween. Unlike attr, which takes a value as its second argument, attrTween requires a helper function, arcTween, which will be called during the intermediary animation ticks. This method was used for my [muniNow project](http

@cmdoptesc
cmdoptesc / .block
Last active February 14, 2018 22:16 — forked from mbostock/.block
Municipalities of Mexico II - How to convert a shapefile to TopoJSON by M Bostock
border: no
height: 600
license: gpl-3.0
@cmdoptesc
cmdoptesc / uszipgeo.json
Last active February 20, 2018 23:11
uszipgeo.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cmdoptesc
cmdoptesc / Readme.md
Last active March 4, 2018 01:53
JavaScript D3: Drawing Concentric Arcs
@cmdoptesc
cmdoptesc / facebook-privacy-guide.md
Last active March 28, 2018 08:40
Facebook Privacy Settings for those who still want to use Facebook

Facebook Privacy Settings for those who still want to use Facebook

Only have five minutes? Read the highlights.

Facebook is an advertising platform that builds profiles about its users through their browsing history and sells them.

Google does the same with your search history and YouTube views. On the other hand, Facebook tracks you because a great number of web sites are littered with Facebook's tiny "Share / Like this" button. A user thinks the button is just there to make sharing easier, but it allows Facebook to keep a record every site the user has been on.

example of tracking button

@cmdoptesc
cmdoptesc / windows_netsh_forwarding.txt
Created June 26, 2018 01:49
Windows port/address forwarding with netsh
netsh interface portproxy show all
netsh interface portproxy add v4tov4 listenport=8081 listenaddress=127.0.0.1 connectport=8081 connectaddress=[remote-ip]
netsh interface portproxy reset
@cmdoptesc
cmdoptesc / concurrent_map_test.py
Last active November 22, 2019 02:46
Python concurrent futures map test playground
#!/usr/bin/env python3
# concurrent_map_test.py
import random
import pendulum
import time
from concurrent import futures
from functools import reduce
@cmdoptesc
cmdoptesc / parallel_lambda_test.py
Created November 22, 2019 02:56
Parallel lambda invocations with Python concurrent futures
#!/usr/bin/env python3
# parallel_lambda_test.py
import random
import pendulum
import time
from concurrent import futures
# The problem is that the AWS boto3 lambda invoke function is not truly asynchronous
@cmdoptesc
cmdoptesc / listing_boto3_exceptions.md
Last active December 11, 2019 18:46
Listing Boto3 Exceptions

Listing Available AWS Boto3 Exceptions

alexpareto commented on Jul 22, 2019

An ugly, but workable solution to find out what exceptions are available on each client from the command line:

import boto3
client = boto3.client('sns')  # or whatever client you're using
# client.exceptions.__dict__