Skip to content

Instantly share code, notes, and snippets.

@swalke16
swalke16 / sna.ical
Created July 22, 2019 20:52
sna ical test
BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:City Events
X-WR-TIMEZONE:America/Chicago
BEGIN:VEVENT
DTSTART:20190725T180000Z
DTEND:20190725T200000Z
@swalke16
swalke16 / sync-places-for-categories.rb
Created February 13, 2019 15:31
Sync Places For New Categories
# this script given that new categories have been created and attached to the relevant apps
# will for the specified account_names and category_names sync all the relevant google places
account_names = ["Baltimore", "Denver", "Los Angeles",
"Short North", "SMRT Columbus"]
category_names = ["Antiques & Vintage", "Beer, Wine, & Spirits", "Juice & Natural Foods"]
accounts = Account.where(name: account_names)
accounts.each do |account|
category_ids = account.categories.where(name: category_names).pluck(:id)
@swalke16
swalke16 / sna.rb
Last active December 6, 2018 18:08
Add SNA Website Places to featured list
# Note this process is bad and currently broken. During this import I discovered that something like 92 records with google IDS matched during the populate step did not exist in our data pulled in by google. Furthermore we had dropped 19 other places that couldn't be matched to google.
#SCRAPE --> IMPORT —> POPULATE —>
web_list = PlaceList.find(51)
goog_list = PlaceList.find(45)
featured_list = FeaturedList.find(12)
PopulateGoogleIdsJob.perform_later(web_list)
=== RUNNING COMMAND IN /Users/swalker/Documents/dev/lendinghome-monolith/client/src/components-core ===
yarn install
yarn install v0.16.1
info No lockfile found.
success Nothing to install.
Done in 0.06s.
=== RUNNING COMMAND IN /Users/swalker/Documents/dev/lendinghome-monolith/client/src/components-core ===
yarn link
@swalke16
swalke16 / coding_assignment.md
Last active March 8, 2016 20:13
Coding Assignment

##Assignment We would like you to create an application that plays the game farkle against a human competitor, and we’d like you to implement it in ruby.

####Guidelines:

  1. Use any resources (books, videos, web sites, etc...) that you need to create your solution. This is a test about how well and fast you can learn.
  2. Use the standard rules for farkle from the wikipedia page.
  3. You don't need to make the interface look pretty. A terminal based interface that shows the state of the game and allows the human to play is fine.
  4. Use git / github as source control and to share the project with us. Remember to try and take small steps, commit frequently, and use meaningful commit messages.
  5. Don't attempt any bonus item(s) (except perhaps unit tests) until you have a working simple solution.
@swalke16
swalke16 / gist:cbc8fd10180d9d04d682
Last active July 20, 2017 14:38
Robot Controller Exercise

#Assignment:

Create a controller for a robot. The controller can respond to 4 commands corresponding to directions of movement (Forward, Back, Left, Right) and should maintain state of the current speed of travel.

Work in whatever language is comfortable for you. This is a test to see how you think about solving problems, not how well you know a specific technology. Show the results of your work either by writing unit tests, or making the controller interactive by accepting input and producing output to your medium of choice (console, web page, etc...).

Left
Forward
@swalke16
swalke16 / gist:1304628
Created October 21, 2011 18:51
Binding Provider
<html>
<head>
<script type='text/javascript' language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type='text/javascript' language="javascript" src="javascripts/knockout.js"></script>
<script type="text/html" id="contactTemplate">
<tr>
<td class='name'></td>
<td class='phone_number'></td>
</tr>
Vundle:
- Alternative package manager for VIM
- Install
- git clone into your .vim dir
- set rtp + call vundle#rc()
- Bundles to install are just setup in your .vimrc or other vim file
- Bundle "<name>" for packages from vimscripts
- Bundle "<git repo>" for github
- Bundle "<user/repo>" for github
- Managing bundles in this way is nice because it's one place to remove bundle
var myScroll;
var a = 0;
function loaded() {
setHeight(); // Set the wrapper height. Not strictly needed, see setHeight() function below.
// Please note that the following is the only line needed by iScroll to work.
// Everything else here is to make this demo fancier.
myScroll = new iScroll('content-scroller', {desktopCompatibility:true});
var scroller = new iScroll(document.getElementById('scroller'), {bounce: false});
$('select').bind('touchstart', function() {
scroller.destroy();
})
.bind('touchend', function()
{
scroller = new iScroll(document.getElementById('scroller'), {bounce: false);
})
.change(function(){