Skip to content

Instantly share code, notes, and snippets.

James Thompson plainprogrammer

Block or report user

Report or block plainprogrammer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am plainprogrammer on github.
  • I am plainprogrammer (https://keybase.io/plainprogrammer) on keybase.
  • I have a public key ASBc2-7Zt54OhRy1XbbESbRzPIL36TuAmOryyeOo58WWiwo

To claim this, I am signing this object:

View daily_herald_article.md

Vineyard charter school under state scrutiny

Braley Dodson Daily Herald 17 hrs ago

The State Charter School Board, part of the Utah State Board of Education, did not take any action on closing a charter school Friday evening after concerns of student safety were brought forward.

The state charter board met to consider taking action on Franklin Discovery Academy in Vineyard, which opened Aug. 22 and teaches about 500 students in kindergarten through sixth grade. However, the board was ultimately unable to act on the matter because it did not issue a notice for the meeting 24 hours in advance.

The board has scheduled a meeting for 7 p.m. Saturday where possible action could be taken, which could include giving the school a warning, putting it on probation, allowing another entity to take over the school or voting to terminate the school.

View gist:0519246455dcd0875814
#!/usr/bin/ruby
rev_10_file = File.open('rev_10.rev', 'a')
rev_172_file = File.new('rev_172.txt', 'w+')
rev_192_file = File.new("rev_192.txt", "w+")
Dir['/Users/andybaxter/bind/*.com'].each do |filename|
File.open(filename, 'r+').readlines.each do |line|
domain = line.split.first
ip = line.split.last
View AssigneesFilterTest.rb
current_user = User.where(full_name: "Jane Fonda").first
current_user.connections.where("full_name LIKE ?", "%bus%").select(:id, :full_name)
#
# User Load (0.6ms)
# SELECT `users`.`id`, `users`.`full_name` FROM `users`
# INNER JOIN `contacts` ON `users`.`id` = `contacts`.`connection_id`
# WHERE `contacts`.`user_id` = 980204181
# AND (full_name LIKE '%bus%')
#
# => #<ActiveRecord::AssociationRelation [
@plainprogrammer
plainprogrammer / scary_service.rb
Last active Oct 28, 2015
Scary Reorder Service
View scary_service.rb
module Services
module Column
class Reorder
attr_reader :column_to_move, :column_before, :column_set
def initialize(column_to_move_id, column_before_id = nil)
@column_to_move = ::Column.find(column_to_move_id)
@column_before = ::Column.find(column_before_id) if column_before_id.present?
@column_set = @column_to_move.column_set
end
View .bash_profile
%{$PROMPT_SUCCESS_COLOR%}%~%{$reset_color%} %{$GIT_PROMPT_INFO%}$(git_prompt_info)%{$GIT_DIRTY_COLOR%}$(git_prompt_status) %{$reset_color%}%{$PROMPT_PROMPT%}ᐅ%{$reset_color%}
View keybase.md

Keybase proof

I hereby claim:

  • I am plainprogrammer on github.
  • I am plainprogrammer (https://keybase.io/plainprogrammer) on keybase.
  • I have a public key whose fingerprint is BF75 7722 AE10 7AE8 4C85 9DE5 5A1F 973B AEB0 18AF

To claim this, I am signing this object:

@plainprogrammer
plainprogrammer / example.rb
Created Nov 22, 2014
Renewable Objects (Immutability by Default) — A more Functional way to do OOP
View example.rb
class Person
include Renewable
attr_accessor :name, :age
def celebrate_birthday
self.renew(age: age + 1)
end
end
john = Person.new(name: 'John', age: 24)
@plainprogrammer
plainprogrammer / PlainBot.rb
Last active Aug 29, 2015
plainprogrammer's RRobot tank-bot
View PlainBot.rb
class PlainBot
include Robot
def tick(events)
get_up_to_speed
turn(2) if (time % turn_adjust == 0)
if events['robot_scanned'].empty?
turn_gun(1)
else
closest = events['robot_scanned'].sort.pop.pop
@plainprogrammer
plainprogrammer / Directions.md
Last active Aug 29, 2015
MongoDB Forced Reconfiguration
View Directions.md

Directions

  1. On the primary, edit /etc/mongod.conf so that it will start and join the evgrs replica set.

  2. On the primary, restart mongod

  3. Get into a mongo console, and run the following series of commands:

    // First we need to connect to the mongo console and copy the current configuration. cfg = rs.conf()

You can’t perform that action at this time.