Skip to content

Instantly share code, notes, and snippets.

View pachun's full-sized avatar

Nicholas Pachulski pachun

View GitHub Profile
# Function to determine if a string contains three consecutive double lectures
# It has been switched slightly to use a for loop instead of a while loop.
def three_double(s):
for i in range(0, len(s)-5):
if s[i] == s[i+1] and s[i+2] == s[i+3] and s[i+4] == s[i+5]:
return True
return False
# Function to apply the three_double test to each string in the words
# list. It counts the number of results.
def strip_windows_newlines(data):
for line in data:
line[-1] = line[-1].rstrip('\r')
return data
def read_census(file_path):
f = open(file_path,'r')
data = []
for line in f:
data.append(line.replace(',','').strip("\n").split("|"))
class Game
attr_accessor :id, :season, :scheduled_at, :scheduled_time, :winning_team_id, :was_played,
:home_team, :away_team, :home_team_players, :away_team_players, :ref, :rounds, :turns
attr_accessor :error, :created, :navigation_stack,
:has_round_details, :shooting_order
def jsonify
json = {
:winning_team_id => @winning_team_id,

######Recruiter

Hi Nicholas,

It’s no surprise that your skills are in high demand right now. I’m working with a number of hiring managers at top tier tech companies…and they’re all looking for Android developers.

Amazon is working with us to hire Senior Consultants and Permanent Android Developers in both Boston and the NY area. Looking for something smaller?

def sidemenu_controller
structure = [
{
custom_title: "News",
drawers: [
{
title: "Retirement Plans",
icon: "retirement_plans.png".uiimage,
},
{
Last login: Fri Dec 27 22:36:58 on ttys007
Nicks-MacBook-Pro:~ pachun$ git clone https://github.com/pachun/bureau
Cloning into 'bureau'...
remote: Counting objects: 352, done.
remote: Compressing objects: 100% (207/207), done.
remote: Total 352 (delta 198), reused 298 (delta 144)
Receiving objects: 100% (352/352), 66.47 KiB | 0 bytes/s, done.
Resolving deltas: 100% (198/198), done.
Checking connectivity... done
Nicks-MacBook-Pro:~ pachun$ cd bureau
class ConsoleCanvas < Array
def height; self.size; end
def width; self[0].size; end
def initialize(w,h)
super(h){Array.new(w,' ')}; system 'stty -icanon -echoke'
end
def set(x,y,v)
self[y.to_i][x.to_i]=v if (0...width).include?(x) && (0...height).include?(y)
class Player < Courier::Base
belongs_to :team, as: :team, on_delete: :nullify
property :id, Integer, required: true
property :name, String
attr_accessor :team_id # not persisted on save
self.json_to_local = {:ID => :id, :PlayerName => :name, :TeamID => :team_id}
self.individual_url = "players/:id"
self.collection_url = "players"
end
class Team < Courier::Base
property :id, Integer32, required: true
property :name, String
property :location, String
self.json_to_local = {:ID => :id, :TeamName => :name, :TeamTown => :location}
self.collection_url = "teams/"
self.individual_url = "teams/:id"
end

Keybase proof

I hereby claim:

  • I am pachun on github.
  • I am pachun (https://keybase.io/pachun) on keybase.
  • I have a public key whose fingerprint is 9322 DD4C 4C64 720C CED9 ADFA 5CE5 F118 2613 2A85

To claim this, I am signing this object: