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 Text.XML.HXT.Core | |
| import Data.Maybe | |
| toAbsoluteUrl | |
| :: ArrowXml a | |
| => String -> a XmlTree XmlTree | |
| toAbsoluteUrl base = | |
| processAttrl (mkAbsolute mkAbsoluteUrl `when` (hasName "href" <+> hasName "src")) | |
| where | |
| mkAbsolute f = replaceChildren (xshow getChildren >>> arr (f base) `orElse` this >>> mkText) |
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 Graphics.X11.ExtraTypes.XF86 | |
| -- Audio buttons | |
| `additionalKeys` | |
| [ ((mod4Mask .|. shiftMask, xK_z), spawn "xscreensaver-command -lock"), | |
| ((0 , xF86XK_AudioLowerVolume), spawn "amixer -q sset Master 2%-"), | |
| ((0 , xF86XK_AudioRaiseVolume), spawn "amixer -q sset Master 2%+"), | |
| ((0 , xF86XK_AudioMute), spawn "amixer set Master toggle") | |
| ] | |
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 os | |
| import redis | |
| from rq import Queue, Connection | |
| from rq.worker import HerokuWorker as Worker | |
| from django.conf import settings | |
| import django | |
| django.setup() | |
| os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dj.settings.production') |
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 from 'react'; | |
| import { Text, View, SafeAreaView, FlatList } from 'react-native'; | |
| import ApolloClient from "apollo-boost"; | |
| import gql from "graphql-tag"; | |
| import { ApolloProvider } from "react-apollo"; | |
| import { Query } from "react-apollo"; | |
| const client = new ApolloClient({ | |
| uri: "https://www.fedry.net/graphql" | |
| }); |
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 from 'react'; | |
| import { Text, View, SafeAreaView, FlatList, WebView, Dimensions, Button, ScrollView} from 'react-native'; | |
| import { ListItem } from 'react-native-elements'; | |
| import ApolloClient from "apollo-boost"; | |
| import gql from "graphql-tag"; | |
| import { ApolloProvider } from "react-apollo"; | |
| import { Query } from "react-apollo"; | |
| import HTML from 'react-native-render-html'; | |
| import { createAppContainer, createStackNavigator} from 'react-navigation'; |
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
| replace' :: Eq b => b -> b -> [b] -> [b] | |
| replace' a b = map (\x -> if (a == x) then b else x) | |
| main = do | |
| f <- readFile "1input" | |
| let l = lines $ replace' '+' ' ' f | |
| map (read::String->Int) l | |
| putStrLn "hi" |
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 from "react"; | |
| import { Query } from "react-apollo"; | |
| import gql from "graphql-tag"; | |
| const Q = gql` | |
| query allPosts($cursor: String) { | |
| allPosts(username: "jmn", first: 1, after: $cursor) { | |
| edges { | |
| node { | |
| id |
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 from "react"; | |
| import { Query } from "react-apollo"; | |
| import gql from "graphql-tag"; | |
| const Q = gql` | |
| query allPosts($cursor: String) { | |
| allPosts(username: "jmn", first: 1, after: $cursor) { | |
| edges { | |
| node { | |
| id |
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 GET_POST = gql` | |
| query post($id: ID!) { | |
| post(id: $id) { | |
| id | |
| title | |
| content | |
| } | |
| } | |
| `; |
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 from "react"; | |
| import { Query } from "react-apollo"; | |
| import gql from "graphql-tag"; | |
| import { Redirect } from "react-router"; | |
| import TagSelect from "./TagSelect"; | |
| const Q = gql` | |
| query allPosts($cursor: String, $tags: String, $id: ID) { | |
| allPosts(username: "jmn", tags: $tags, id: $id, first: 1, after: $cursor) { | |
| edges { |