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
<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
# 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
<?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
{"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
{ | |
"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
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
import { FaExternalLinkAlt } from 'react-icons/fa' | |
/** | |
* This is the schema definition for the rich text fields used for | |
* for this blog studio. When you import it in schemas.js it can be | |
* reused in other parts of the studio with: | |
* { | |
* name: 'someName', | |
* title: 'Some title', | |
* type: 'blockContent' | |
* } |
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
type SanityClientOptions = { | |
projectId: string; | |
dataset: string; | |
token?: string; | |
useCdn?: boolean; | |
}; | |
type QueryParameters = Record<string, string | number>; | |
const sanityClient = (options: SanityClientOptions) => { |
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
import React, { | |
useEffect, useState | |
} from 'react' | |
import DefaultPane from '@sanity/components/lib/panes/DefaultPane' | |
import client from 'part:@sanity/base/client' | |
const CustomPane = (props) => { | |
const [groups, setGroups] = useState([]) | |
useEffect(() => { |