This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sanityClient = require('@sanity/client') | |
const client = sanityClient({ | |
projectId: 'your-project-id', | |
dataset: 'production', | |
token: 'token-with-create-session-rights', | |
useCdn: false | |
}) | |
const accessDocument = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"center" : { | |
"lat": 59.9, | |
"lng": 10.75 | |
}, | |
"radius": 1000 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"updated":"2017-12-07 06:26:45 +0000","articles":[{"title":"USA ber Israel dempe begeistringen over Jerusalems status","link":"https://www.nrk.no/urix/usa-ber-israel-dempe-begeistringen-over-jerusalems-status-1.13812740"},{"title":"Trump junior nektet å svare i Kongressen","link":"https://www.nrk.no/urix/trump-junior-nektet-a-svare-i-kongressen-1.13812770"},{"title":"Gynekologer utfører unødvendige undersøkelser","link":"https://www.nrk.no/troms/gynekologer-utforer-unodvendige-undersokelser-1.13812578"},{"title":"Vi stoler mindre på svin, men spiser mest av det","link":"https://www.nrk.no/rogaland/1.13809639"},{"title":"Hus truffet av ras på Osterøy","link":"https://www.nrk.no/hordaland/hus-truffet-av-ras-pa-osteroy-1.13812800"},{"title":"Johansson satte ny junior verdensrekord for andre gang","link":"https://www.nrk.no/sport/johansson-satte-ny-junior-verdensrekord-for-andre-gang-1.13812749"},{"title":"Skogbranner truer Los Angeles' rikeste","link":"https://www.nrk.no/urix/skogbranner-truer-los-angeles_-rike |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<rss version="2.0"> | |
<channel> | |
<title>Forsida RSS</title> | |
<ttl>60</ttl> | |
<description>Forsida RSS</description> | |
<link>http://forsidaapp.com/rss</link> | |
<lastBuildDate>Mon, 02 Feb 2015 19:58:00 +0100</lastBuildDate> | |
<!-- Aftenposten --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Main lib | |
class Object | |
@@_enforced_rules = {} | |
def self.enforce(*actions, &block) | |
@@_enforced_rules[enforcement_klass] ||= {} | |
actions.flatten.each do |action| | |
@@_enforced_rules[enforcement_klass][action] = block | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<input id="file" type="file" accept="image/*" /> | |
<br/> | |
<h2>As read:</h2> | |
<img id="placeholder1" width=300/><br/> | |
<h2>Rotated by exif data:</h2> | |
<img id="placeholder2" width=300/> | |
<script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// call when zoom level or page size changes (i.e. after zooming or after rotation) | |
- (void)updateContentInsetForPageScrollView:(UIScrollView *)pageScrollView { | |
UIImageView *imageView = (UIImageView *) [pageScrollView viewWithTag:TAG_IMAGE_VIEW]; | |
CGFloat zoomScale = pageScrollView.zoomScale; | |
CGSize imageSize = imageView.bounds.size; | |
CGSize zoomedImageSize = CGSizeMake(imageSize.width * zoomScale, imageSize.height * zoomScale); | |
CGSize pageSize = pageScrollView.bounds.size; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"> | |
<channel> | |
<title>Magic Music Changes</title> | |
<link>https://gist.github.com/runeb/8774083/raw/gistfile1.xml</link> | |
<description>Most recent changes with links to updates.</description> | |
<language>en</language> | |
<item><title>Version 1.0 (12)</title><pubDate>Sun, 02 Feb 2014 21:35:32 +0000</pubDate><enclosure url="http" length="1234567890" type="application/octet-stream" sparkle:version="12" sparkle:shortVersionString="1.0" sparkle:dsaSignature="dsa"/></item></channel> | |
</rss> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) | |
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) | |
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) | |
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) | |
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def xmp(filename) | |
xap = "http://ns.adobe.com/xap/1.0/\0".freeze | |
f = File.open(filename, 'r') | |
xml = nil | |
begin | |
return nil unless f.readbyte == 0xFF | |
return nil unless f.readbyte == 0xD8 | |
while !f.eof | |
case f.readbyte |