Skip to content

Instantly share code, notes, and snippets.

View twe4ked's full-sized avatar
🐦
just setting up my twttr

Odin twe4ked

🐦
just setting up my twttr
View GitHub Profile
@twe4ked
twe4ked / input.scss
Created December 5, 2011 06:27
FREE! Sass (SCSS) mixin for including retina images (useful when developing for iOS).
@mixin background-image-retina($file, $type, $width, $height) {
background-image: url($file + '.' + $type);
@media (-webkit-min-device-pixel-ratio: 2), (-moz-min-device-pixel-ratio: 2) {
& {
background-image: url($file + '@2x.' + $type);
-webkit-background-size: $width $height;
}
}
}
@twe4ked
twe4ked / chosen.rb
Created May 8, 2012 00:38
Testing chosen with RSpec.
def search_chosen(selector, search)
page.execute_script "jQuery('#{selector}').click();"
find('div.chzn-search input').set search
end
def select_from_chosen(selector, name)
page.execute_script "jQuery('#{selector}').click();"
page.execute_script "jQuery(\".chzn-results .active-result:contains('#{name}')\").click();"
wait_for_ajax
end
use std::collections::HashSet;
use std::sync::{Arc, RwLock, RwLockReadGuard};
/// A HashSet that allows controlling when items are actually removed from the list.
/// This can be helpful if you need to keep track of items being added over time
/// and ensuring that they don't get added _and_ removed before you've read them.
struct LockedHashSet {
values: Arc<RwLock<HashSet<u64>>>,
values_marked_for_removal: Arc<RwLock<HashSet<u64>>>,
}
use crate::entities::player::Player;
use bevy::input::{keyboard::KeyCode, Input};
use bevy::prelude::*;
use bevy::render::camera::Camera;
const PLAYER_SPEED: f32 = 500.0;
const PADDING: f32 = 100.0;
pub fn player_movement_system(
time: Res<Time>,
@twe4ked
twe4ked / odinbox.markdown
Last active July 29, 2019 05:01
odinbox

odinbox

  • Intel Core i5 8400 Base:2.80GHz, Turbo:4.00GHz / 9MB / LGA1151 / 6 Core / 65W / Coffee Lake
  • Gigabyte GeForce GTX 1080 Windforce OC GV-N1080WF3OC-8GD
  • MSI Z370-A PRO Motherboard MSI Z370-A PRO MB, Z370, 4x DDR4, 2x PCIE3.0 x16, 4x PCI-E3.0 x1, 6x SATA3, M.2, 8x USB3.1, VGA, DVI, DisplayPort, ATX, White LED
  • Corsair Vengeance LPX 16GB (2x8GB) 3200MHz DDR4 CMK16GX4M2B3200C16
  • OCZ Agility 3 240G SATA3 SSD
  • Corsair TX-850 V2 ATX Power Supply 140mm fan
  • Thermaltake Black Commander MS-II Mid Tower Chassis (USB3)

A User Manual for NAME

Working practices:

What does your perfect working day look like?

What’s your favourite method of communication?

What are your quirks?

What qualities do you particularly value in the people you work with?

What things do people sometimes misunderstand about you?

What stresses you out / frustrates you at work?

# frozen_string_literal: true
class SchemaDump
VERSION_REGEX = /
^--\sDumped\sfrom\sdatabase\sversion.*$\n
^--\sDumped\sby\spg_dump\sversion.*$\n
^\n
/x
def self.call(database_url, filename:)
#!/usr/bin/env ruby
#
# Lazy sources:
#
# - https://stackoverflow.com/a/6018744
# - https://stackoverflow.com/a/4179491
require 'time'
def ranges_overlap?(a, b)
module Sequel
class Dataset
alias_method :execute_orig, :execute
def execute(*args, &block)
SequelNotifications.subscribers.each do |subscriber|
subscriber.call(*args, &block)
end
execute_orig(*args, &block)
end
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end