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
Problem: Virgin common runs apt-get update, writes a file named apt-get.updated, but it only runs apt-get update once, if apt-get-updated does not exist | |
It only runs apt-get update then installs a list of packages |
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 eshadata | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
CREATE PROCEDURE insert_or_update_common_name | |
-- Add the parameters for the stored procedure here |
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
Jennifer: Thank you for contacting ThinkGeek! My name is Jennifer. How can I help you today? | |
David Herman: Trying to determine if I order something if it will make it by the 25th and what shipping method I can chose | |
David Herman: *choose | |
David Herman: order number is 64eaf9c02 | |
David Herman: hello? | |
Jennifer: Hi sorry to keep you waiting. Let me check on that. | |
David Herman: that's ok, I'm guessing you guys are a tad busy ;) | |
Jennifer: The status is incomplete. Do you want me to complete your order David. Sorry fore the inconvenience. | |
David Herman: No, I want to know what type of shipping I would need to do to get it here before the 25th | |
Jennifer: Do you want me to expedite the method? |
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
:template{id: "foo"} | |
.this | |
.that.somethingelse | |
%h1 Title | |
.body | |
some text {{foo}} |
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 ApplicationController < ActionController::Base | |
@@page_title = nil | |
def self.set_title(page_title) | |
@@page_title = page_title | |
end | |
def page_title | |
ignore_for = %w{sessions devise} |
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
Rails.application.eager_load! #ensure all controllers are loaded | |
ApplicationController.descendants.each do |controller| | |
puts "#{controller.name}" | |
end |
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
foo_plan: | |
FOO_ID: 1 | |
bar_group: | |
FOO_ID: foo_plan #doesn't work | |
FOO: foo_plan #doesn't work | |
FOO_ID: 1 #works but not ideal |
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
{ | |
"query": { | |
"filtered": { | |
"filter": { | |
"and": [ | |
{ | |
"and": [ | |
{ | |
"or": [ | |
{ |
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
average = (50.0 + 75.0 + 90.0) / 3.0 => 71.66666666666667 (14 decimal places) | |
average = ratings.average(:rating).to_f => 71.6666666666667 (13 decimal places) | |
:rating is a double in postgres. | |
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
/* ******************************************* | |
// LICENSE INFORMATION | |
// The code, "Detecting Smartphones Using PHP" | |
// by Anthony Hand, is licensed under a Creative Commons | |
// Attribution 3.0 United States License. | |
// | |
// Updated 01 March 2010 by Bryan J Swift | |
// - Remove un-needed if statements instead just returning the boolean | |
// inside the if clause | |
// |
NewerOlder