Skip to content

Instantly share code, notes, and snippets.

View dkastl's full-sized avatar

Daniel Kastl dkastl

View GitHub Profile
@MinjeJeon
MinjeJeon / Dockerfile
Last active February 16, 2023 16:36 — forked from kmpm/install-weasyproxy.sh
Small file that installes ad uses weasyprint instead of wkhtmltopdf on linuxserver bookstack containers..
FROM linuxserver/bookstack:latest
COPY ./install-weasyproxy.sh /tmp/
RUN sh /tmp/install-weasyproxy.sh
RUN mkdir /custom-cont-init.d/
COPY ./init-weasyproxy.sh /custom-cont-init.d/
@naftulikay
naftulikay / s3-cloudfront-invalidation.sh
Last active November 7, 2022 21:44
Sync a directory to S3 and invalidate the CloudFront cache for changed resources.
#!/bin/bash
# output format is like this:
# upload: index.html to s3://$BUCKET/index.html
#
# so we grab the second item which is the file path and pass that via xargs to the
# cloudfront invalidation command
aws s3 sync --sse AES256 s3://$BUCKET/ site/ | awk '{print $2;}' | \
xargs aws cloudfront create-invalidation --distribution-id $CF_DISTRO_ID --paths
@ealden
ealden / gist:a8849293bf96a3aed0b37fc345cb3e25
Last active October 10, 2017 22:19
Ruby install in Ubuntu 16.04 LTS
# Install dependencies as root
apt install -y git build-essential libssl-dev libreadline-dev zlib1g-dev
# Install rbenv
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
# Install ruby-build
// Structure for Point, Geo coordinates can be represented with it
typedef struct
{
double X, Y;
}Point;
// Structure to keep cost, distance and traveltime. If distance/ traveltime is missing, there may be a negative flag
typedef struct
@tgpfeiffer
tgpfeiffer / japanese-full.tex
Last active November 15, 2021 17:57
How to typeset Japanese with advanced features in (Xe)LaTeX.
\documentclass[12pt]{article}
\usepackage{xltxtra, setspace}
%% fonts
% xeCJK options from <http://mesokosmos.blogger.de/stories/1818274/>:
\usepackage[%
boldfont,
CJKnumber,
@kesor
kesor / Gemfile
Created March 19, 2013 00:32
Vagrant configuration to install two Ubuntu 12.04 servers, first server has a Chef Server installed, second server has a Chef Client installed, and the folder where these files are places is configured to be a Chef Workstation using admin.pem.
source "https://rubygems.org"
gem 'chef', '>= 11.0'
gem 'librarian'
gem 'vagrant', '= 1.0.6'
gem 'vagrant-hostmaster'
gem 'foodcritic'
@galulex
galulex / install.md
Last active February 28, 2021 14:15
Ruby On Rails Ubuntu 18.04 install

Developer libs

mysql, rmagic, curl, git, vim, sqlite, nodejs nokogiri...

sudo apt-get install libxslt1-dev libxml2-dev build-essential patch libsqlite3-dev libcurl4-openssl-dev curl git git-gui vim-gtk exuberant-ctags nodejs rar

Ruby

sudo apt-add-repository ppa:brightbox/ruby-ng

sudo apt-get update

@ivoba
ivoba / install_silverstripe.sh
Created February 8, 2012 12:24
silverstripe installer using submodules
# install silverstripe + common modules from github
# usage sh install_silverstripe.sh <folder_name> <tag/branch>
# examples:
# sh install_silverstripe.sh some_folder tags/2.4.5
# sh install_silverstripe.sh some_folder master
#set up project base folder
git clone git@github.com:silverstripe/silverstripe-installer.git $1
cd $1
git checkout $2
@youtalk
youtalk / node-ja-sanitize.js
Created January 12, 2012 06:35
Sanitizing and Japanese full/half-width character converting for Node.js
var validator = require('validator');
var hankaku = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ';
var zenkaku = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ';
var zenkakuToHankaku = function (word) {
for (var i = 0, n = zenkaku.length; i < n; i++) {
word = word.replace(new RegExp(zenkaku[i], 'gm'), hankaku[i]);
}
return word.replace(/^\s+|\s+$/g, ''); // trim head and tail white space
};