Skip to content

Instantly share code, notes, and snippets.

View dianaow's full-sized avatar
🐱

Diana dianaow

🐱
View GitHub Profile
@phortuin
phortuin / postgres.md
Last active April 30, 2024 02:26
Set up postgres + database on MacOS (M1)

Based on this blogpost.

Install with Homebrew:

$ brew install postgresql@14

(The version number 14 needs to be explicitly stated. The @ mark designates a version number is specified. If you need an older version of postgres, use postgresql@13, for example.)

@dianaow
dianaow / .block
Created March 6, 2019 13:18
Evenly spaced nodes around center: Method 2
license: mit
@dianaow
dianaow / .block
Last active March 6, 2019 14:09
Evenly spaced nodes around center: Method 1
license: mit
@phuysmans
phuysmans / gist:4f67a7fa1b0c6809a86f014694ac6c3a
Created January 8, 2018 09:29
docker compose health check example
version: '2.1'
services:
php:
tty: true
build:
context: .
dockerfile: tests/Docker/Dockerfile-PHP
args:
version: cli
volumes:
@sjengle
sjengle / .block
Last active April 24, 2024 13:04 — forked from mbostock/.block
Flight Paths Edge Bundling
license: gpl-3.0
height: 500
border: no
@monkut
monkut / Ubuntu1604py36Dockerfile
Last active June 14, 2023 20:31
Base Docker image for ubuntu-16.04 & Python3.6
# docker build -t ubuntu1604py36
FROM ubuntu:16.04
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:jonathonf/python-3.6
RUN apt-get update
RUN apt-get install -y build-essential python3.6 python3.6-dev python3-pip python3.6-venv
RUN apt-get install -y git
@amitai10
amitai10 / this_in_react.md
Created November 18, 2016 20:52
How to use "this" keyword in JavaScript in general and react in particular

Using "this” in react functions

JavaScript is great, but comparing to other programing languages it has many confusing parts. One of them is the use of this.

In this blog post I will explain how to use it right, and what are the tools that JavaScript provide us to ease the use of it. In the end, I will focus on react.

3 types of functions

@biovisualize
biovisualize / modules.json
Created May 31, 2016 14:38
D3 v4 modules
{
"d3-array": {
"dependencies": [],
"description": "Array manipulation, ordering, searching, summarizing, etc.",
"exported": ["version", "bisect", "bisectRight", "bisectLeft", "ascending", "bisector", "descending", "deviation", "extent", "histogram", "thresholdFreedmanDiaconis", "thresholdScott", "thresholdSturges", "max", "mean", "median", "merge", "min", "pairs", "permute", "quantile", "range", "scan", "shuffle", "sum", "ticks", "tickStep", "transpose", "variance", "zip"]
},
"d3-axis": {
"dependencies": ["d3-scale", "d3-selection", "d3-transition"],
"description": "Displays automatic reference lines for scales.",
"exported": ["version", "axisTop", "axisRight", "axisBottom", "axisLeft"]
@jlln
jlln / separator.py
Last active November 9, 2023 19:59
Efficiently split Pandas Dataframe cells containing lists into multiple rows, duplicating the other column's values.
def splitDataFrameList(df,target_column,separator):
''' df = dataframe to split,
target_column = the column containing the values to split
separator = the symbol used to perform the split
returns: a dataframe with each entry for the target column separated, with each element moved into a new row.
The values in the other columns are duplicated across the newly divided rows.
'''
def splitListToRows(row,row_accumulator,target_column,separator):
split_row = row[target_column].split(separator)
@krosenberg
krosenberg / README.md
Last active February 19, 2023 19:41
D3 "force" layout with nodes situated around a circle

####D3 "force" layout with nodes situated around a circle

This network graph uses the D3 force layout to draw nodes and links, but instead of using d3.force() to find the best node positions, we draw an invisible arc and evenly places nodes along the circumference.