Skip to content

Instantly share code, notes, and snippets.

View jsoendermann's full-sized avatar

Jan Söndermann jsoendermann

View GitHub Profile
@jsoendermann
jsoendermann / jekyll.sh
Last active August 24, 2020 17:11
Running jekyll inside docker
docker run \
--rm \
-it \
--volume="$PWD:/srv/jekyll" \
--volume="$PWD/vendor/bundle:/usr/local/bundle" \
-p 8080:8080 \
-p 35729:35729 \
--env JEKYLL_ENV=production \
jekyll/jekyll:3.8 \
jekyll serve --watch --livereload --port 8080
@jsoendermann
jsoendermann / PortraitStyleTransfer.py
Created October 6, 2019 10:39 — forked from titu1994/PortraitStyleTransfer.py
Partial implementation of "Painting Style Transfer for Head Portraits using Convolutional Neural Networks".
from scipy.misc import imread, imresize, imsave
from scipy.optimize import fmin_l_bfgs_b
import numpy as np
import time
import os
import argparse
import h5py
from keras.models import Sequential
from keras.layers.convolutional import Convolution2D, ZeroPadding2D, AveragePooling2D, MaxPooling2D
interface RowSegment {
width: number
canStartLine?: boolean | undefined
canEndLine?: boolean | undefined
}
// This implementation isn't fully currect since it never backtracks more than one element but it's good enough for now
export const sentenceLayoutAlgo = <T extends RowSegment>(
rowSegments: T[],
lineWidth: number,
@jsoendermann
jsoendermann / Dockerfile
Last active June 27, 2018 04:17
Serve jekyll site with nginx
FROM alpine:3.7 as build-env
MAINTAINER Jan Soendermann
# This list of packages was taken from the official jekyll image.
# Some of them are probably not required but since this is
# just a build env, it doesn't matter so much.
RUN \
apk --update add readline readline-dev libxml2 libxml2-dev libxslt \
libxslt-dev python zlib zlib-dev ruby ruby-dev yaml \
yaml-dev libffi libffi-dev build-base nodejs ruby-io-console \
@jsoendermann
jsoendermann / gitlg.sh
Created December 26, 2017 08:54
git lg
[alias]
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
@jsoendermann
jsoendermann / aliases.sh
Last active November 26, 2020 11:11
useful aliases
alias gs="git status -sb"
alias gd="git diff"
alias ga="git add"
alias gh="git checkout"
alias gc="git commit"
alias gcn="git commit --no-verify"
alias gca="git commit --amend --no-edit"
alias gp="git push"
alias gpl="git pull"
alias gpr="git pull --rebase"
@jsoendermann
jsoendermann / oss-upload.sh
Created November 22, 2017 02:18
阿里云 Aliyun OSS curl upload 上传
RESOURCE="/${OSS_BUCKET_NAME}/${OBJECT_NAME}"
CONTENT_MD5=$(openssl dgst -md5 -binary "${FILEPATH}" | openssl enc -base64)
CONTENT_TYPE=$(file -ib "${FILEPATH}" |awk -F ";" '{print $1}')
DATE_VALUE="`TZ=GMT date +'%a, %d %b %Y %H:%M:%S GMT'`"
STRING_TO_SIGN="PUT\n${CONTENT_MD5}\n${CONTENT_TYPE}\n${DATE_VALUE}\n${RESOURCE}"
SIGNATURE=$(echo -e -n $STRING_TO_SIGN | openssl dgst -sha1 -binary -hmac $OSS_ACCESS_KEY_SECRET | openssl enc -base64)
URL="http://${OSS_BUCKET_NAME}.${OSS_REGION}.aliyuncs.com/${OBJECT_NAME}"
curl -i -q -X PUT -T "${FILEPATH}" \
-H "Host: ${OSS_BUCKET_NAME}.${OSS_REGION}.aliyuncs.com" \
-H "Date: ${DATE_VALUE}" \
@jsoendermann
jsoendermann / project-names.md
Last active August 11, 2017 04:40
Project Names
  • angry ant
  • bashful bee
  • cunning cod
  • dodgy dove
  • edgy eel
  • fidgety frog
  • gregarious giraffe
  • hapless hedgehog
  • inept impala
  • jovial jaguar
@jsoendermann
jsoendermann / rn-native-pro-cons.md
Last active July 10, 2017 03:05
React Native vs Native

React Native

+++ Our team has lots of experience with JavaScript + React

+++ Build once for both platforms

++ Much better developer experience (faster turnaround times)

+ Can update without having to go through the app store most of the time

@jsoendermann
jsoendermann / sectionListGetItemLayout.jsx
Last active December 9, 2019 21:16
sectionListGetItemLayout
import sectionListGetItemLayout from 'react-native-section-list-get-item-layout'
class MyComponent extends React.Component {
constructor(props) {
super(props)
this.getItemLayout = sectionListGetItemLayout({
// The height of the row with rowData at the given sectionIndex and rowIndex
getItemHeight: (rowData, sectionIndex, rowIndex) => sectionIndex === 0 ? 100 : 50,