Skip to content

Instantly share code, notes, and snippets.

@davidimoore
davidimoore / gist:f880964aeac0723b87f5
Last active August 29, 2015 14:06
Thor script for restarting solr and indexing key value search terms
require 'thor/group'
class Startup < Thor::Group
no_tasks do
def confirm(method)
if $?.to_i == 0
puts "#{method} executed successfully"
end
end
end
@davidimoore
davidimoore / _flexbox-grid.scss
Last active August 29, 2015 14:07
Flex Grid Values with Bourbon Mixins
.flex-container{
box-sizing: border-box;
padding: .5rem;
}
.flex-row{
box-sizing: border-box;
@include display(flex);
@include box-orient(horizontal);
@davidimoore
davidimoore / gist:3eae756f7d7150552c55
Last active August 29, 2015 14:10
Linux Bloat Removal
#Games
gnome-mines gnome-orca gnome-sudoku gnomine nautilus-sendto-empathy aisleriot brltty gnome-mahjongg
#Productivity
libreoffice thunderbird rhythmbox rhythmbox-client evolution zeitgeist telepathy evolution-data-server-online-accounts
#Utilities & Media
gnome-accessibility-themes totem brasero cheese cheese-common unity-control-center-signon usb-creator-gtk onboard gnome-orca unity-webapps-common gkbd-capplet ibus-pinyin grc signon-ui gnome-disk-utility ibus-pinyin foo2zjs
#Internet
source 'https://rubygems.org'
ruby "2.1.4"
gem 'rails', '4.1.8'
gem 'pg'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
#stubs
describe '#solution' do
it 'delegates to its clone' do
clone = double("clone")
solution = double("solution")
#prepares clone
allow(clone).to receive(:solution).and_return(solution)
participation = Participation.new(clone:clone)
@davidimoore
davidimoore / gist:8fe5771d626bc5cf0d85
Last active August 29, 2015 14:14
Media Query Breakpoints
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
@davidimoore
davidimoore / sublime-php-shortcuts.md
Last active August 29, 2015 14:17
Sublime Shortcuts for PHP
  • Jump to definition = Super+Click
  • Jump to definition = Control+Super+Alt+Up
  • Go back = Control+Super+Alt+Left
  • Manual CodeIntel = Control+Shift+space
EnergySaver = (function(){
return{
NAME: "Energy Saver",
VERSION: 1.0,
calculate: function(formSelector, peakDemand, electricalDemand, totalBill){
var peakDemand = $(peakDemand);
var electricalDemand = $(electricalDemand);
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta name="keywords" content="">
<meta name="description" content="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
function obj_present($resource, $value){
if(isset($resource[$value]) || $resource[$value] != '0'){
return $resource[$value];
}
}
function image_tag($image_data) {
echo "<img src='" . img::getImg($image_data, 1) . "'>";
}