Skip to content

Instantly share code, notes, and snippets.

View ftes's full-sized avatar

Fredrik Teschke ftes

View GitHub Profile
@ftes
ftes / vcxproj-use-v110.ps1
Last active January 21, 2016 17:53
Use v110 platform toolset instead of inten in all .vcxproj files located (recursively) in current directory
Get-Childitem -recurse -Filter "*.vcxproj" | `
Foreach-Object {
set fileName $_.FullName
set tmp GetTempFileName
cat $fileName | %{$_ -replace "\<PlatformToolset\>Intel C\+\+ Compiler XE 13\.0\<\/PlatformToolset\>","<PlatformToolset>v110</PlatformToolset>"} | Out-File -Encoding ASCII $tmp
del $fileName
mv $tmp $fileName
}
mysql:
image: 'mariadb:latest'
environment:
- MYSQL_ROOT_PASSWORD=<pw>
wordpress:
image: 'wordpress:latest'
environment:
- [email protected]
- LETSENCRYPT_HOST=url.com
- VIRTUAL_HOST=url.com
nginx-letsencrypt:
image: 'jrcs/letsencrypt-nginx-proxy-companion:latest'
volumes:
- '/etc/ssl/certs:/etc/nginx/certs'
- '/var/run/docker.sock:/var/run/docker.sock:ro'
volumes_from:
- nginx-proxy
nginx-proxy:
image: 'jwilder/nginx-proxy:latest'
environment:
@ftes
ftes / update.sh
Created April 12, 2018 12:05
Arch Linux Updates Indicator update command
gnome-terminal -e 'sh -c "aurman -Syu --noconfirm ; pacman -Syu --noconfirm ; echo Done - Press enter to exit; read" '
@ftes
ftes / GeneratedRepoTest.groovy
Created February 11, 2019 09:06
Spring data mongo + Testcontainers
package de.ftes.examples.spring_data_mongo_testcontainers
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.context.ApplicationContextInitializer
import org.springframework.context.ConfigurableApplicationContext
import org.springframework.core.env.PropertySource
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories
import org.springframework.test.context.ContextConfiguration
import org.testcontainers.containers.GenericContainer
@ftes
ftes / gist:d17d7e0d543028cb36e37fee16a53da1
Created March 13, 2019 09:22
Convert confluence to adoc
Steps:
1. `npm run start ../html ../md` (https://www.npmjs.com/package/confluence-to-markdown)
2. `for f in *.md; do pandoc "$f" -s -t asciidoc -o "${f%.md}.adoc"; done`
3. Manual cleanup (tables, images)
@ftes
ftes / guitar-chords.csv
Last active September 11, 2019 19:17
Guitar chords as CSV with fingering notation for Latex songs package http://songs.sourceforge.net/songsdoc/songs.html#mac.gtab
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 13 columns, instead of 8 in line 4.
base_human , base_tex, maj , sus2 , sus4 , 6 , 7 , 7sus4 , 9 , m , m6 , m7 , m9
C , C , X32010:032010, (335533):113411, X330(11):034011, X3221X:043210, X3231X:032410, X3331X:023410, X3233X:021340, X3554X:013420, X312XX:031200, X(35343):013121, X3133X:021340
C\shrp / D\flt, D& , XXX121:000132, 4:(113311):113411, 4:(113341):112341, X4332X:043210, X4342X:032410, XX0213:000213, X4344X:021340, X421XX:042100, X423XX:031200, X4(242)X:031410, X4244X:021340
D , D , XX0232:000132, 000230:000130, X00233:000134, XX0202:000102, XX0212:000213, XX0213:000213, XX0210:000210, XX0231:000231, XX0201:000201, XX02(11):000211, 5:000120:000120
D\shrp / E\flt, E& , XXX343:000132, 6:(113311):113411, 6:(113341):112341, XX101X:001020, XXX323:000213, XXX324
@ftes
ftes / _form.html.haml
Last active August 12, 2021 01:24
simple_form initializer for Bulma (input, select, checkbox)
-# Example form
= simple_form_for @some_model do |f|
-# Show error notification at top (general error text)
= f.error_notification
-# Show base errors at top
= f.error_notification message: (f.error :base) if f.object.errors[:base].present?
-# Regular input
= f.input :name, autofocus: true
-# Select input referencing other model
@ftes
ftes / _error_messages.html.haml
Last active April 27, 2022 20:42
Rails bulma form builder with errors
-# layouts/_error_messages.html.haml
- if f.object.errors.any?
.notification.is-danger Please review the problems below:
- if f.object.errors[:base].present?
.notification.is-danger= f.object.errors[:base].join(', ')
@ftes
ftes / _seating_plan.html.haml
Created November 20, 2019 21:26
Drag and drop in CSS grid with rails 6, stimulus and rails-ujs
-# https://johnbeatty.co/2018/03/09/stimulus-js-tutorial-how-do-i-drag-and-drop-items-in-a-list/
.grid--draggable{ 'data-controller': 'seating-plan',
'data-seating-plan-endpoint': endpoint,
'data-action': 'dragstart->seating-plan#onDragStart dragover->seating-plan#onDragOver dragenter->seating-plan#onDragEnter drop->seating-plan#onDrop dragend->seating-plan#onDragEnd' }
- seating_plan.each do |seat|
- if seat[:is_empty]
.grid__item.grid__item--empty{ 'data-row': seat[:row],
'data-col': seat[:col],
style: "grid-row: #{seat[:row]}; grid-column: #{seat[:col]};",
class: ('grid__item--border' if seat[:is_border]) }