Skip to content

Instantly share code, notes, and snippets.

View huned's full-sized avatar
💭
I may be slow to respond.

Huned Botee huned

💭
I may be slow to respond.
View GitHub Profile
>> 0.days.ago.to_s :activity
=> "Today"
>> 1.days.ago.to_s :activity
=> "Thursday"
>> 2.days.ago.to_s :activity
=> "Wednesday"
>> 3.days.ago.to_s :activity
=> "Tuesday"
>> 4.days.ago.to_s :activity
=> "Monday"
irb(main):021:0> FlashMailer.flash c, p
NoMethodError: undefined method `ascii_only?' for nil:NilClass
from /u/apps/syn/shared/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/encodings.rb:189:in `encode_non_usascii'
from /u/apps/syn/shared/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/encodings.rb:184:in `address_encode'
from /u/apps/syn/shared/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/encodings.rb:181:in `block in address_encode'
from /u/apps/syn/shared/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/encodings.rb:181:in `map'
from /u/apps/syn/shared/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/encodings.rb:181:in `address_encode'
from /u/apps/syn/shared/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/fields/common/common_address.rb:20:in `encode_if_needed'
from /u/apps/syn/shared/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/fields/common/common_address.rb:9:in `parse'
from /u/apps/syn/shared/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/fields/bcc_field.rb:42:in `initialize'
@huned
huned / russell_3000_2011-06-27.csv
Created May 11, 2012 01:20
Ticker symbols for all the companies in the Russell 3000 Index as of 2011-06-27
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
A
ACO
AA
ACOM
AAN
ACOR
AAON
ACPW
AAP
ACTG
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
@huned
huned / rbenv-install-system-wide.sh
Created March 15, 2012 20:30
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
ruby-1.9.2-p180 :004 > puts Answer.where(question_id: nil).order('created_at ASC').inject(Hash.new(0)) {|h, a| h[a.created_at.to_date] += 1; h }.to_yaml
---
2011-06-26: 24
2011-07-12: 2
2011-07-13: 2
2011-07-22: 2
2011-09-24: 1
2011-10-10: 4
2011-10-13: 8
2011-10-14: 4
:És, :Étantdonné, :Étantdonnée, :Étantdonnées, :Étantdonnés, :Þegar, :Þá, :Şi, :Și, :І, :А, :Агар, :Але, :Али, :Аммо, :Атакож, :Бирок, :Ва, :Дадено, :Дано, :Допустим, :Если, :Задате, :Задати, :Задато, :И, :Кад, :Када, :Когато, :Когда, :Коли, :Ктомуже, :Лекин, :Нехай, :Но, :Онда, :Припустимо, :Припустимощо, :Пусть, :Та, :То, :Тогда, :Тоді, :Унда, :Якщо, :אבל, :אז, :אזי, :בהינתן, :וגם, :כאשר, :اذاً, :بفرض, :ثم, :عندما, :لكن, :متى, :و, :かつ, :しかし, :ただし, :ならば, :もし, :並且, :但し, :但是, :假如, :假定, :假設, :假设, :前提, :同时, :同時, :并且, :当, :當, :而且, :那么, :那麼, :그러면, :그리고, :단, :만약, :만일, :먼저, :조건, :하지만]
@huned
huned / string.rb
Created February 8, 2012 23:17
String#stopword?
class String
# via https://github.com/endax/stopwords/blob/master/lib/stopwords.rb
STOP_WORDS = [
'a','cannot','into','our','thus','about','co','is','ours','to','above',
'could','it','ourselves','together','across','down','its','out','too',
'after','during','itself','over','toward','afterwards','each','last','own',
'towards','again','eg','latter','per','under','against','either','latterly',
'perhaps','until','all','else','least','rather','up','almost','elsewhere',
'less','same','upon','alone','enough','ltd','seem','us','along','etc',
'many','seemed','very','already','even','may','seeming','via','also','ever',
parseEmailAddressesFromString = function(s) {
// match email address formats
var r = /([a-z0-9._%+-]+@[a-z0-9.-]+(?:\.[a-z]{2,4})*)/i
, o = {}
, keys = [];
// populate properties in o
s.toLowerCase().split(r).forEach(function(fragment) {
if (r.test(fragment)) o[fragment.trim()] = true;
});
@huned
huned / amendment.md
Created December 21, 2011 04:07
an amendment to excise the concept of "underlying service provider technology" to obivate the need to negotiate around licensing and transferability

§4.3 Upon termination of this Agreement, within five (5) days of such termination, Client agrees to pay Service Provider all amounts due or accrued as of the date of such termination. If Service Provider terminates this Agreement due to a default or breach by Client, Client shall immediately return to Service Provider, and cease all further use of, all Underlying Service Provider Technology (as defined in Section 6 below), if any, and Deliverables and all copies of any documents, magnetically encoded materials, any software, drawings, flow charts, structure charts, and recording media and other materials furnished to Client or used by Service Provider in rendering the Services for which full payment has not been made, and any assignment or license granted to Client under this Agreement for the same shall be revoked. Client agrees to reassign any rights granted by Service Provider to Client relating to the same. Upon termination of this Agreement for any reason, each party shall return to the other party o