Skip to content

Instantly share code, notes, and snippets.

View reneweteling's full-sized avatar
🤓
Just coding away :)

Rene Weteling reneweteling

🤓
Just coding away :)
View GitHub Profile
@reneweteling
reneweteling / heroku.rake
Created August 12, 2015 07:58
Heroku rake task to import your remote database locally
namespace :heroku do
task :import_remote_database => :environment do
return 'Only in development' unless Rails.env.development?
puts "From what heroku app do you want to import the database?"
remote = STDIN.gets.chomp
puts "Creating dump on heroku, takes a while"
heroku_command('pg:backups capture', remote)
@reneweteling
reneweteling / slack.rake
Last active September 26, 2017 14:25
Bulk remove slack files older than 1 month
namespace :slack do
task :dropfiles do
token = 'xoxp-?????' # h&f
# get upser id
user_id = 'U02B4AR0N'
# get files
cmd = "curl -s -X POST --data '#{{token: token, count: 1000, user: user_id}.to_query}' https://slack.com/api/files.list"
@reneweteling
reneweteling / gitbranches.rb
Created July 6, 2018 08:39
Little command to print all git branches of all folders in specified location
#!/usr/bin/env ruby
# Author: René Weteling
# Email: rene@weteling.com
# Description: Command to list all branches of all folders at a specified
# locaton. Handy if you have multiple projects.
# Installation:
# 1 - Store in your path (usually ~/bin/gitbranches)
# 2 - Make executable (chmod +x gitbranches)
# 3 - Source your terminal, and enjoy (gitbranches [path || '.'])
@reneweteling
reneweteling / Loader.scala
Last active August 14, 2018 09:20
Test for play application in an Lagom setup
import com.aceandtate.stock.api.StockService
import com.lightbend.lagom.scaladsl.api.{ LagomConfigComponent, ServiceAcl, ServiceInfo }
import com.lightbend.lagom.scaladsl.client.LagomServiceClientComponents
import com.lightbend.lagom.scaladsl.devmode.LagomDevModeComponents
import com.softwaremill.macwire._
import controllers.StockController
import play.api.ApplicationLoader.Context
import play.api.libs.ws.ahc.AhcWSComponents
import play.api.{ ApplicationLoader, BuiltInComponentsFromContext, Mode }
import play.filters.HttpFiltersComponents
@reneweteling
reneweteling / Versioning.md
Created March 22, 2019 13:21
Automatic commit versioning

Init npm and add semantic-release

npm init
npm add semantic-release --save-dev

Commitizen

tar -czf /storage-backup-$(date +"%d").tar.gz /home/dokku/storage && AWS_ACCESS_KEY_ID=$AWS_KEY AWS_SECRET_ACCESS_KEY=$AWS_SECRET aws s3 cp /storage-backup-$(date +"%d").tar.gz s3://$AWS_BUCKET && rm /storage-backup-$(date +"%d").tar.gz
@reneweteling
reneweteling / vscode-settings.md
Last active August 30, 2019 07:22
VsCode Develop settings Rene

Install fonts

https://github.com/tonsky/FiraCode

Add the prettier plugin for auto formatting on save

npm init
npm install --save-dev prettier @prettier/plugin-ruby

Add these gems to the develop group in the Gemfile

@reneweteling
reneweteling / cloudSettings
Last active May 26, 2021 13:39
Vscode Sync settings
{"lastUpload":"2021-05-26T13:39:19.811Z","extensionVersion":"v3.4.3"}
@reneweteling
reneweteling / Armbian.md
Last active December 8, 2021 08:13
Armbian setup for octoprint

Seeer project

The project consists of 2 repositories, one for the frontend (nodejs vuejs) one for the backend (php laravel). To install the correct versions of php, node etc. just run asdf install and if you dont have asdf installed, shame on you! https://github.com/asdf-vm/asdf and install the asdf plugins for php, nodejs (google is your friend)

Backend

Make sure you have mysql installed brew install mysql (mac) than create a database and make sure the credentials are compliant with the .env file. You can also ask sohail for a production database to have some data.