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
use bevy::input::keyboard::KeyboardInput; | |
use bevy::prelude::{EventReader, KeyCode, ResMut, Resource}; | |
use std::process::exit; | |
#[derive(Resource)] | |
pub struct KonamiCombo(pub usize); | |
pub fn keyboard_events( | |
mut key_evr: EventReader<KeyboardInput>, | |
mut konami_combo: ResMut<KonamiCombo>, |
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
require 'rspec/expectations' | |
# expect(response).to be_json_success | |
RSpec::Matchers.define :be_json_success do |_expected| | |
match do |actual| | |
actual.status == 200 && actual.content_type.match("application/json") | |
end | |
failure_message do |actual| | |
"expected status: 200, content_type: 'application/json', got status: #{actual.status}, content_type: '#{actual.content_type}'" |
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
require 'rails_helper' | |
FactoryBot.factories.map(&:name).each do |factory_name| | |
describe "The #{factory_name} factory" do | |
it 'is valid' do | |
expect(build(factory_name)).to be_valid | |
end | |
it 'creates without error' do | |
expect { create(factory_name) }.to_not raise_error |
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
# Kickstart file for failing graphical installation based on anaconda output from Qubes R2 | |
install | |
auth --enableshadow --passalgo=sha512 | |
cdrom | |
firstboot --enable | |
keyboard --vckeymap=us --xlayouts='' | |
lang en_US.UTF-8 | |
network --hostname=dom0 --bootproto=dhcp | |
timezone America/Chicago --isUtc |
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
--search and replace vars | |
--Database=some_db | |
--User=some_user | |
-- show roles, and db level permissions | |
\du | |
--show permissions on table | |
\z *.* |
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
# frozen_string_literal: true | |
# Uses pg's trigram extension to enable multi column searches | |
# | |
# add a search method to your model | |
# def self.search(query) | |
# SimilaritySearch.new(self, over: [:name, :email, :nickname]).search(query) | |
# end | |
# | |
# Then call it with Foo.search("bar") |
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
CC = /usr/bin/gcc | |
CFLAGS = -g -Wall | |
LFLAGS = -lcs50 | |
BIN = hello | |
all: $(BIN) | |
$(BIN): | |
$(CC) $(CFLAGS) -o $(BIN) $(BIN).c $(LFLAGS) |
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
# Adjust paths/versions as necessary (this was just my experience) | |
wget http://download.osgeo.org/postgis/source/postgis-2.2.1.tar.gz | |
tar zxvf postgis-2.2.1.tar.gz | |
cd postgis-2.2.1 | |
./configure --with-pgconfig=/usr/local/bin/pg_config --with-geosconfig=/usr/local/Cellar/geos/3.5.0/bin/geos-config --with-projdir=/usr/local/Cellar/proj/4.9.2 | |
make | |
make install |