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 String | |
def get_domain | |
URI(self).host.match(/[^\.]+\.\w+$/).to_s | |
end | |
end | |
class Node | |
attr_accessor :a, :b, :c | |
def initialize(data) | |
@data = data |
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
output = `gem list --no-versions` | |
output = output.split("\n") | |
output.each do |gem| | |
system("gem uninstall #{gem}") | |
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
Trade.all.each do |trade| | |
trade.created_at += 175.days | |
trade.save | |
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
#!/usr/bin/python | |
import os | |
import time | |
import subprocess | |
from time import strftime | |
# EV level | |
photo_ev = 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
<html> | |
<head> | |
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.js"></script> | |
</head> | |
<body> | |
<h1>Todo List</h1> | |
<table class="todo-list"> | |
<th style="padding-right: 30px;">Todo</th> |
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 Employee | |
attr_accessor :name, :title, :salary, :boss | |
def initialize | |
@name | |
@title | |
@salary | |
@boss | |
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
def argv_test | |
filename = ARGV.shift | |
game_save = File.readlines(filename) | |
p game_save | |
x = gets.chomp | |
p x | |
end | |
argv_test |
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 sum_of_pairs(arr) | |
max_length = 0 #max length of subset | |
#go through all subsets | |
for i in 0..(arr.size - 2) | |
for j in (i + 1)..(arr.size - 1) | |
sub_arr = arr[i..j] | |
sub_arr_length = sub_arr.length | |
if is_good?(sub_arr) | |
max_length = sub_arr_length if sub_arr_length > max_length |
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
####### install Git ########## | |
Use install Git section of Pro Git | |
can install from graphical Git installer or Macports | |
http://sourceforge.net/projects/git-osx-installer/ | |
Note: I'm fine with my Git version |
NewerOlder