Skip to content

Instantly share code, notes, and snippets.

Avatar
💬
Writing code...

Andrew Kalek anlek

💬
Writing code...
View GitHub Profile
@anlek
anlek / aws_cli_simple_test.sh
Last active Oct 1, 2020
BASH function to test what version of AWS CLI you're using.
View aws_cli_simple_test.sh
[[ $(aws --version 2>&1) == aws-cli/1* ]] && echo "AWS CLI is V1" || echo "AWS CLI IS > V1"
@anlek
anlek / docker-compose.yml
Created Aug 21, 2019
Setting up error page for traefik and it's applications
View docker-compose.yml
app:
image: my/webapp:latest
labels:
- "traefik.enable=true"
- "traefik.frontend.rule=Host:supercoolapp.com"
- "traefik.frontend.errors.network.backend=error"
- "traefik.frontend.errors.network.query=/{status}.html"
- "traefik.frontend.errors.network.status=500-511"
- "traefik.port=3000"
error_pages:
@anlek
anlek / auto_dubstep.rb
Created Feb 3, 2018 — forked from xavriley/auto_dubstep.rb
Auto generating dubstep with Sonic Pi
View auto_dubstep.rb
# DUBSTEP
# Combines ideas from my other gists
current_bpm = 140.0
use_bpm current_bpm
# WOBBLE BASS
define :wob do
use_synth :dsaw
lowcut = note(:E1) # ~ 40Hz
highcut = note(:G8) # ~ 3000Hz
@anlek
anlek / application.scss
Last active Apr 30, 2020
My current work around for simple_form and Bootstrap 4 beta to work together (till simple_form allows input fields to have `is-invalid` set on it on error - see https://github.com/plataformatec/simple_form/pull/1476)
View application.scss
// Fix for validations on simple form
// Need to import bootstrap functions and mixins if you want to dynamically set colors
// Otherwise replace theme-color... with hex color
@import 'bootstrap/functions';
@import 'bootstrap/variables';
@import 'bootstrap/mixins';
.has-invalid {
.invalid-feedback {
View Node Modules
yarn list v0.27.5
├─ abbrev@1.1.0
├─ accepts@1.3.3
│ ├─ mime-types@~2.1.11
│ └─ negotiator@0.6.1
├─ accounting@0.4.1
├─ acorn-dynamic-import@2.0.2
│ ├─ acorn@^4.0.3
│ └─ acorn@4.0.13
├─ acorn-globals@1.0.9
@anlek
anlek / Console output
Created Nov 3, 2016
Ruby 2.3 installation freezes during building of Passenger-Docker
View Console output
In case of problems: https://rvm.io/help and https://twitter.com/rvm_io
+ Updating /etc/profile.d/rvm_secure_path.sh
+ chmod +x /etc/profile.d/rvm_secure_path.sh
+ usermod -a -G rvm app
+ install -o root /pd_build/ruby_support/system-rvm-exec.sh /usr/bin/rvm-exec
+ Creating /usr/bin/ruby
+ Creating /usr/bin/gem
+ Creating /usr/bin/rake
+ Creating /usr/bin/bundle
+ Creating /usr/bin/bundler
View gist:bd20598692459a10e84b8e9b9467b0bd
<template lang="jade">
#example
button(@click="greet") Greet
</template>
<script>
export default {
data () {
return {
@anlek
anlek / console
Created Apr 8, 2016
Installing vue-loader issue.
View console
% npm install vue-loader --save AirNorth/tarmac (feature/vuejs ⚡) Andrews-MacBook-Pro
npm WARN vue-loader@8.2.2 requires a peer of vue-html-loader@^1.0.0 but none was installed.
npm WARN vue-loader@8.2.2 requires a peer of css-loader@* but none was installed.
npm WARN vue-loader@8.2.2 requires a peer of vue-style-loader@^1.0.0 but none was installed.
npm WARN vue-loader@8.2.2 requires a peer of babel-loader@^6.1.0 but none was installed.
npm WARN vue-loader@8.2.2 requires a peer of babel-core@^6.1.2 but none was installed.
npm WARN vue-loader@8.2.2 requires a peer of babel-plugin-transform-runtime@^6.1.2 but none was installed.
npm WARN vue-loader@8.2.2 requires a peer of babel-runtime@^5.8.0 but none was installed.
npm WARN vue-loader@8.2.2 requires a peer of babel-preset-es2015@^6.1.2 but none was installed.
npm WARN vue-loader@8.2.2 requires a peer of vue-hot-reload-api@^1.2.0 but none was installed.
View terminal-output
$ root@ed4b13372429:/# bundle -v
bash: bundle: command not found
$ root@ed4b13372429:/# gem install bundler -V
HEAD https://api.rubygems.org/api/v1/dependencies
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=bundler
200 OK
Getting SRV record failed: DNS result has no information for _rubygems._tcp.api.rubygems.org
/var/lib/gems/2.2.0/gems/bundler-1.11.2/.gitignore
/var/lib/gems/2.2.0/gems/bundler-1.11.2/.rspec
View application_helper.rb
def nav_link(name, path, options={})
options[:class] = append_class(options[:class], "#{"active" if active_path?(path)}")
options[:role] ||= "menuitem"
link_to name, path, options
end
def active_path?(path)
request.path == path
end