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
def armstrong_number(num) | |
s_num = num.to_s | |
len = s_num.length | |
sc = s_num.split(//).inject(0) {|sum, i| sum + i.to_i * len} # inject ะบะฐะบ ัั ัะถะต ะฟะพะฝัะป ะฟัะพั ะพะดะธััั ะฟะพ ะฒัะตะผั | |
# ะผะฐััะธะฒั ะธ ะตัะต ะฟะปัั ะบ ัะพะผั ะถะต ัะพั ัะฐะฝัะตั ััะผะผั. | |
# ะกัะผะผั ัั ัะพััะฐะฒะปัะตัั ัะฐะผ. 0 ะทะดะตัั ะฟะตัะฒะพะฝะฐัะฐะปัะฝะพะต ัะพััะพัะฝะธะต ััะผะผั | |
puts (num == sc ? "BINGO! #{s_num} - ัะฒะปัะตััั ัะธัะปะพะผ ะัะผัััะพะฝะณะฐ" : "#{s_num} - ะฝะต ัะฒะปัะตััั ัะธัะปะพะผ ะัะผัััะพะฝะณะฐ") | |
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
# encoding: utf-8 | |
require 'yaml' | |
module Proxy | |
OVERRIDEN_METHODS = %w(get post put delete).freeze | |
APP_CONFIG = YAML.load(File.open File.join(File.dirname(__FILE__), '../config/application.yml')) | |
def self.included(base) | |
base.class_eval do | |
OVERRIDEN_METHODS.each do |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
<nav> | |
<ul> | |
<li> | |
<a href="/">Home</a> | |
</li> | |
<li> | |
<a href="">RubyGardens</a> | |
<ul class="sec"> | |
<li class="fst"><span></span></li> | |
<li><span><b>RubyGardens</b></span></li> |
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
root@saygo:~# aptitude install ruby1.9 | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
Reading extended state information | |
Initializing package states... Done | |
Writing extended state information... Done | |
The following NEW packages will be installed: | |
libruby1.9{a} ruby1.9 | |
0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded. |
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
$.fn.submitWithAjax = function(params) { | |
var options = { | |
type : this.attr('method') || 'POST', | |
url : this.attr("action"), | |
data : this.serialize(), | |
callbacks : {}, | |
target : '#temp', | |
freezing : this, | |
dataType : 'script', | |
autoActivate : true |
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
root@saygo:/home/ubuntu# update-rc.d nginx defaults | |
perl: warning: Setting locale failed. | |
perl: warning: Please check that your locale settings: | |
LANGUAGE = (unset), | |
LC_ALL = (unset), | |
LC_CTYPE = "UTF-8", | |
LANG = "en_US.UTF-8" | |
are supported and installed on your system. | |
perl: warning: Falling back to the standard locale ("C"). | |
update-rc.d: using dependency based boot sequencing |
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
62] pry(main)> a = Startup.solr_search{fulltext 'test'}.results | |
Startup Load (0.2ms) SELECT "startups".* FROM "startups" WHERE "startups"."id" IN (1) | |
=> [#<Startup id: 1, name: "test", url: "", digital_media_vertical: nil, differentiator_factor: "", tracking_platform: "", ad_units: "", full_description: "", existing_clients: "", user_id: 1, created_at: "2012-01-11 12:38:51", updated_at: "2012-01-11 12:38:51", views_count: nil, approved: nil>] | |
[63] pry(main)> a = Startup.solr_search{fulltext 't'}.results | |
=> [] |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one or more | |
contributor license agreements. See the NOTICE file distributed with | |
this work for additional information regarding copyright ownership. | |
The ASF licenses this file to You under the Apache License, Version 2.0 | |
(the "License"); you may not use this file except in compliance with | |
the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
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
This file contains any messages produced by compilers while | |
running configure, to aid debugging if configure makes a mistake. | |
It was created by libcouchbase configure 0.3.0_80_geb7c70c, which was | |
generated by GNU Autoconf 2.68. Invocation command line was | |
$ ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/libcouchbase/80 --disable-couchbasemock --with-memcached-headers-url=https://raw.github.com/membase/memcached/engine/include/memcached | |
## --------- ## | |
## Platform. ## |
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
Dependencies Resolved | |
=================================================================================================================================================================================================================== | |
Package Arch Version Repository Size | |
=================================================================================================================================================================================================================== | |
Installing: | |
libxml2-devel i386 2.6.26-2.1.2.8.el5_5.1 base 2.1 M | |
libxml2-devel x86_64 2.6.26-2.1.2.8.el5_5.1 |