Skip to content

Instantly share code, notes, and snippets.

View jarkko's full-sized avatar

Jarkko Laine jarkko

View GitHub Profile
module MetroUi.Widgets.Accordion exposing ( Model
, defaultAccordion
, update
, view )
import Html
import Html.App
import Html.Attributes as Attr
import MetroUi.Widgets.Frame as Frame
@jarkko
jarkko / gist:ab9b598ceace6bf7fe74
Created May 16, 2014 12:35
Adding a new record to a hasMany relationship
App.SplitPointController = Ember.ObjectController.extend(
actions: {
recordSplit: ->
split = @store.createRecord('splitTime',
timestamp: new Date
splitPoint: @get('model')
)
@get('model').get('splitTimes').addObject(
split.save()

Keybase proof

I hereby claim:

  • I am jarkko on github.
  • I am jarkko (https://keybase.io/jarkko) on keybase.
  • I have a public key whose fingerprint is 953F 35EE 6327 BD0F 3958 2BAA 74A6 11CD C6E7 8E69

To claim this, I am signing this object:

irb(main):004:0> a = Event.limit(5)
Event Load (0.4ms) SELECT `events`.* FROM `events` LIMIT 5
=> […]
irb(main):006:0> a.map(&:id)
=> [1, 2, 3, 4, 5]
irb(main):008:0> a.reject!{|i| i.id == 1}
=> […]
irb(main):010:0> a.map(&:id)
=> [2, 3, 4, 5]
irb(main):011:0>
@jarkko
jarkko / gist:3617540
Created September 4, 2012 06:21
Mobiilikakkonen #2

Aiheita

  • AntiSec hackers leak 1,000,001 Apple device IDs allegedly obtained from FBI breach
  • “During the second week of March 2012, a Dell Vostro notebook, used by Supervisor Special Agent Christopher K. Stangl from FBI Regional Cyber Action Team and New York FBI Office Evidence Response Team was breached using the AtomicReferenceArray vulnerability on Java, during the shell session some files were downloaded from his Desktop folder one of them with the name of ”NCFTA_iOS_devices_intel.csv” turned to be a list of 12,367,232 Apple iOS devices including Unique Device Identifiers (UDID), user names, name of device, type of device, Apple Push Notification Service tokens, zipcodes, cellphone numbers, addresses, etc. the personal details fields referring to people appears many times empty leaving the whole list incompleted on many parts. no other file on the same folder makes mention about
@jarkko
jarkko / gist:3022845
Created June 30, 2012 07:45
Scotrubyconf 2012 5K results

Results

  1. 18:48.65 86 Jarkko Laine
  2. 22:13.40 100 Lars Hoeg
  3. 24:51.08 90 Sean Handley
  4. 25:06.11 89 Chris McGrath
  5. 25:46.37 88 Paul Wilson
  6. 25:51.84 91 Gar Morley
  7. 33:31.82 92 bridget gleason
  8. 40:56.70 87 Adam Hendricksen
.date {
font-family: "rock salt", serif;
position: relative;
top: 10em;
}
@jarkko
jarkko / gist:2134102
Created March 20, 2012 11:02
Rails Time.zone.parse bug
1.9.3p125 :003 > Time.zone = "Pacific Time (US & Canada)"
=> "Pacific Time (US & Canada)"
1.9.3p125 :004 > Time.zone
=> (GMT-08:00) Pacific Time (US & Canada)
1.9.3p125 :005 > Time.zone.parse("2012-03-25 03:29")
=> Sun, 25 Mar 2012 04:29:00 PDT -07:00
1.9.3p125 :006 > Time.zone.parse("2012-03-24 03:29")
=> Sat, 24 Mar 2012 03:29:00 PDT -07:00
1.9.3p125 :007 > Time.zone = "UTC"
=> "UTC"
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by git-commit with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, make this file executable.
# This is slightly modified from Andrew Morton's Perfect Patch.