This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update next | |
on: | |
pull_request: | |
paths: | |
- "Gemfile.lock" | |
jobs: | |
update: | |
runs-on: ubuntu-20.04 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Minitest | |
module Reporters | |
# Based on https://github.com/kern/minitest-reporters/blob/master/lib/minitest/reporters/progress_reporter.rb | |
# Tries to adhere to https://testanything.org/tap-specification.html | |
class TapReporter < DefaultReporter | |
def report | |
super | |
puts("TAP version 13") | |
puts("1..#{tests.length}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2 | |
jobs: | |
build: | |
working_directory: ~/mowers | |
docker: | |
- image: circleci/ruby:2.4.1-node | |
environment: | |
PGHOST: 127.0.0.1 | |
PGUSER: mower | |
RAILS_ENV: test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const calendar = { | |
initialize() { | |
const calendars = document.getElementsByClass('fullcalendar'); | |
Array.from(calendars).forEach(function(cal) { | |
const place = cal.dataset.place; | |
cal.html(''); // Remove any previous calendar | |
cal.fullCalendar({ | |
eventSources: [{ url: '/events/feed.json?place=' + place }], | |
other_options:... | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup Sidekiq for rails on Debian | |
# This setup uses systemd to start via terminal but also via the deploy system Capistrano. | |
# The reload-task will not actually reload the service, but is used to prepare Sidekiq for shutdown | |
# There exists two services to allow for both staging and production environment. | |
# The application uses different redis databases by using different numbers to connect, | |
# i.e. localhost:6379/0 or :6379/1, which are set in each applications environment variables. | |
# Any questions about the configuration? Hit me up | |
# David Wessman, Lund , 2016-09-07, [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OrderItem < ActiveRecord::Base | |
belongs_to :product, required: true | |
belongs_to :order, required: true | |
has_one :user, through: :order | |
validates :quantity, presence: true, numericality: { only_integer: true, greater_than: 0 } | |
validate :user_limited | |
before_save :finalize | |
def unit_price |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
development: | |
adapter: mysql2 | |
encoding: utf8 | |
database: db/app_development | |
username: root | |
password: | |
host: localhost | |
production: | |
adapter: mysql2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def setAxLinesBW(ax): | |
""" | |
Take each Line2D in the axes, ax, and convert the line style to be | |
suitable for black and white viewing. | |
""" | |
MARKERSIZE = 3 | |
COLORMAP = { | |
'b': {'marker': None, 'dash': (None,None)}, | |
'g': {'marker': None, 'dash': [5,5]}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% This needs to be set to be able to print | |
fig = figure; | |
% If you want multiple plots in the figure | |
hold on; | |
I = 0:1:9; | |
blue = [0, 0.048, 0.143, 0.129, 0.236, 0.333, 0.479, 0.512, 0.582, 0.678]; | |
red = [0, 0.095, 0.106, 0.171, 0.156, 0.227, 0.270, 0.300, 0.366, 0.384]; | |
plot(I, blue,'+b') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% https://www.ctan.org/pkg/listings | |
\usepackage[procnames]{listings} | |
\usepackage{color} %red, green, blue, yellow, cyan, magenta, black, white | |
\definecolor{mygreen}{RGB}{28,172,0} % color values Red, Green, Blue | |
\definecolor{mylilas}{RGB}{170,55,241} | |
% Python style for highlighting | |
\newcommand\matlabstyle{\lstset{ | |
language=Matlab |
NewerOlder