This file contains hidden or 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 send_email(to, subject, body) | |
puts "sending email => #{subject}" | |
IO.popen(CONFIG[:sendmail_command],"w+") do |sm| | |
message = | |
%Q{Date: #{Time.now} | |
From: House Notify <[email protected]> | |
To: #{to} | |
Subject: #{subject} | |
Mime-Version: 1.0 |
This file contains hidden or 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 Contactable | |
def self.append_features(klass) | |
super | |
klass.extend(Macros) | |
end | |
def Macros | |
def acts_as_contactable | |
extend ClassMethods | |
include InstanceMethods |
This file contains hidden or 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
-(void)openHighScoreView { | |
GameOverView *tempView = [[HighScoreView alloc] init]; | |
selfish = tempView; | |
[tempView release]; | |
[[CCDirector sharedDirector]replaceScene:[MainScene node]]; | |
[UIView beginAnimations:nil context:NULL]; | |
[UIView setAnimationDuration:.5]; | |
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:[[CCDirector sharedDirector] openGLView] cache:YES]; | |
[[[CCDirector sharedDirector] openGLView] addSubview:go.view]; |
This file contains hidden or 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 'qor/resources_engine' | |
module Admin | |
class RepOps::SimpleScoredHistoriesController < Admin::ResourcesController | |
prepend_before_filter :pamper_resources_engine | |
layout 'resources/tis' | |
def show_history | |
@retailer = Retailer.find(params[:retailer_id]) | |
@simple_scored_history = @retailer.simple_scored_history_to_be_displayed(params[:simple_scored_history_id]) |
This file contains hidden or 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 ActionController | |
module ImplicitRender | |
def default_render | |
# lookup template exist? go to render it | |
render and return if template_exists?(action_name.to_s, _prefix) | |
has_template = begin | |
old_formats, @lookup_context.formats = @lookup_context.formats, Mime::SET.symbols | |
template_exists?(action_name.to_s, _prefix) |
This file contains hidden or 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 ActionController | |
module ImplicitRender | |
def send_action(method, *args) | |
ret = super | |
unless response_body | |
if template_exists?(action_name.to_s, _prefixes) | |
default_render | |
else | |
process_not_found_template |
This file contains hidden or 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 'rubygems' | |
require 'csv' | |
def normalize(row) | |
row[2].sub!(/^0+/, "") if row[2] | |
row[3].sub!(/^0+/, "") if row[3] | |
return row | |
end |
This file contains hidden or 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
MySQL: SELECT * FROM user WHERE name = "foobar"Mongo: db.user.find({"name" : "foobar"}) | |
MySQL: INSERT INOT user (`name`, `age`) values ("foobar",25) | |
Mongo: db.user.insert({"name" : "foobar", "age" : 25}) | |
MySQL: DELETE * FROM user | |
Mongo: db.user.remove({}) | |
MySQL: DELETE FROM user WHERE age < 30 | |
Mongo: db.user.remove({"age" : {$lt : 30}}) $gt : > ; $gte : >= ; $lt : < ; $lte : <= ; $ne : != | |
MySQL: UPDATE user SET `age` = 36 WHERE `name` = "foobar" | |
Mongo: db.user.update({"name" : "foobar"}, {$set : {"age" : 36}}) | |
MySQL: UPDATE user SET `age` = `age` + 3 WHERE `name` = "foobar" |
This file contains hidden or 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 "digest" | |
@json_data = '{"device_id":"3079c62cc69de1eace695459207e41d71f4a53f3","logs":[{"kid_name":"Raspu","option_id":"あか","book_id":"50041a0b9a208511cd000004","question_id":"5020b1c99a208574b0000013"},{"kid_name":"Raspu","option_id":"き","book_id":"50041a0b9a208511cd000004","question_id":"5020b81c9a208574b000001f"}]}' | |
@correct_token = Digest::SHA2.new << "#{@json_data}3079c62cc69de1eace695459207e41d71f4a53f3" | |
puts @correct_token |
This file contains hidden or 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
[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]; | |
[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]; |
OlderNewer