Skip to content

Instantly share code, notes, and snippets.

View kristianfreeman's full-sized avatar
🙃

Kristian Freeman kristianfreeman

🙃
View GitHub Profile
class Fixnum
def double
self * 2
end
end
@kristianfreeman
kristianfreeman / lol.rb
Created January 15, 2014 01:41
imessage is garbage
# run this shit in ~/Library/Messages
@last = ""
while true do
@mine = false
@new = `sqlite3 chat.db 'select text, is_from_me from message order by date desc limit 1;'`
@from = @new.split("|").last.chomp
@mine = true if @from == "1"
@new = @new.split("|").first
unless @last == @new.split("|").first
//
// emojis.h
// NSStringEmojize
//
// Created by Andrew Sliwinski on 1/6/14.
// Copyright (c) 2014 DIY. All rights reserved.
//
#define EMOJI_HASH @{ \
@":+1:" : @"\U0001F44D", \
@kristianfreeman
kristianfreeman / wwdc_rename.rb
Created March 18, 2014 16:32
Renaming script for WWDC 2013 videos
class WWDC
NAMES = {
"100" => "Keynote",
"101" => "Platforms State of the Union",
"102" => "Apple Design Awards",
"109" => "Painting the Future",
"200" => "Accessibility in OS X",
"201" => "Building User Interfaces for iOS 7",
"202" => "Accessibility in iOS",
"203" => "What's New in Cocoa Touch",
@kristianfreeman
kristianfreeman / examples.rb
Created April 2, 2014 02:25
easy currency in rails
product = Product.new price_cents: 5000
product.price_string # => "$50.00"
product = Product.new price_cents: 51254
product.price_string # => "$512.54"
product = Product.new price_cents: 512
product.price_string # => "$5.12"
@kristianfreeman
kristianfreeman / secretz.rb
Created April 4, 2014 18:32
example code to make all soundcloud playlists/tracks private
client = Soundcloud.new(access_token: access_token)
#tracks
tracks = client.get '/me/tracks'
tracks.each do |track|
# obviously this logic is pretty simple, so it can be reversed easily
if track.sharing == "public"
client.put(track.uri, track: {
sharing: 'private'
})
@kristianfreeman
kristianfreeman / bootstrap.sh
Last active August 29, 2015 13:59
bootstrapping without scary devops tools because #retro
echo "Checking for requirements:"
if [ -d "/Applications/Xcode.app/Contents/Developer" ]; then
XCODE_FOUND=true
echo "\t✓ Found Xcode.app."
else
echo "\t✗ Missing Xcode.app. Install it from the App Store."
echo "In Terminal? Command + Double click to open Xcode.app in the Mac App Store."
echo "http://appstore.com/mac/xcode"
exit 1

2014-05-07

  • Intro message is shown on first opening
  • Graph is disabled on first run
  • Table is disabled on first run
  • Music should be enabled
  • Can accept rating
  • Can accept note
  • Can accept picture
  • Can take picture
@kristianfreeman
kristianfreeman / selecta_ag.vim
Created May 13, 2014 20:50
really, really fast vim filtering
" Requirements:
" selecta: https://github.com/garybernhardt/selecta
" ag: https://github.com/ggreer/the_silver_searcher
" Run a given vim command on the results of fuzzy selecting from a given shell
" command. See usage below.
function! SelectaCommand(choice_command, selecta_args, vim_command)
try
silent let selection = system(a:choice_command . " | selecta " . a:selecta_args)
catch /Vim:Interrupt/
@kristianfreeman
kristianfreeman / err.md
Created May 16, 2014 04:09
the potentially mean message to the app review dude

Hey,

I'm a little confused at the response here. Cited is "Reason 10.6": "Apple and our customers place a high value on simple, refined, creative, well thought through interfaces. They take more work but are worth it. Apple sets a high bar. If your user interface is complex or less than very good it may be rejected."

Feeling is a data capture app, so the implementation of the act of capturing data is very intentionally designed. I could have designed it for capturing as many events per day as desired, but I chose not to – that's an implementation and design detail that I feel strongly about. Besides, if a user feels like their previous rating of the day is inaccurate, they can go back and change the rating later with no consequence.

Can you explain to me why you feel that this is a example of poor user experience? As far as I can tell, this has nothing to do with user experience; if, hypothetically, you could record multiple events per day, they would appear exactly the same as five days' worth would