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
| module Foo | |
| ( module Control.Applicative | |
| , g | |
| ) where | |
| import Control.Applicative | |
| g :: Int | |
| g = 1 |
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
| {-# LANGUAGE EmptyDataDecls, FlexibleContexts, GADTs, OverloadedStrings, QuasiQuotes, TemplateHaskell, TypeFamilies #-} | |
| module A where | |
| import Database.Persist.TH | |
| share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase| | |
| A | |
| |] |
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
| (defun delete-trailing-whitespace-and-extra-nl () | |
| (interactive) | |
| (let ((two? (ends-with-two-linebreaks?))) | |
| (progn | |
| (delete-trailing-whitespace) | |
| (if (and two? (string-match "silk" (buffer-file-name))) | |
| (save-excursion | |
| (let ((undo-list (undo-copy-list buffer-undo-list))) | |
| (progn | |
| (buffer-disable-undo) |
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
| <!-- page structure showing the title (line 7) and subtitle (line 8) --> | |
| <article> | |
| <section class="body"> | |
| <div class="layout meta"> <!-- left column --> | |
| <div class="block header text" data-component-uri="http://silkapp.com/component/block/text"> | |
| <h1>Title</h1> | |
| <p>Subtitle</p> | |
| </div> | |
| </div> |
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
| # create new page (or adjust existing page) called 'test' | |
| $ curl https://api.silkapp.com/v1.4.0/site/uri/yoursite.silkapp.com/page/test | |
| -d '<article>...</article>' | |
| -b 'silk_sid=...' | |
| -X PUT | |
| -H 'Content-Type: application/xml' |
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
| ;; Enable editable dired mode. | |
| (add-hook 'dired-mode-hook | |
| (lambda () | |
| (define-key dired-mode-map | |
| "r" 'wdired-change-to-wdired-mode) | |
| (setq truncate-lines t))) | |
| ;; Enable a in dired mode to view a file w/o creating a new buffer. | |
| (put 'dired-find-alternate-file 'disabled nil) | |
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
| Haskell: | |
| data Select = FirstAlternative String String | |
| | SecondAlternative Select Select | |
| | ThirdAlternative Select | |
| printSelect :: Select -> IO () | |
| printSelect (FirstAlternative str1 str2) = | |
| putStr("FirstAlternative(" ++ str1 ++ ", " ++ str2 ++ ")") | |
| printSelect (SecondAlternative sel1 sel2) = do |
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
| Prelude Text.Regex.Posix> "bar" =~ "(foo|bar)" :: Bool | |
| <interactive>:1:7: | |
| No instances for (RegexMaker Regex CompOption ExecOption [Char], | |
| RegexContext Regex [Char] Bool) | |
| arising from a use of `=~' | |
| Possible fix: | |
| add instance declarations for | |
| (RegexMaker Regex CompOption ExecOption [Char], | |
| RegexContext Regex [Char] Bool) |
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
| #!/usr/bin/env ruby | |
| pairs = [] | |
| while !(print '> ') && (s = gets.strip) != '' | |
| word,num = /^(\S+)\s*(\d+)?$/.match(s)[1..2] | |
| if num | |
| pairs << [word,num.to_i] | |
| else | |
| print(pairs.map { |p_word,p_num| | |
| p_num == word.chars.zip(p_word.chars).inject(0) { |s,(a,b)| s + (a == b ? 1 : 0) } | |
| }.all? ? "match\n" : "no match\n") |
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
| cpanm (App::cpanminus) 1.4008 on perl 5.010001 built for x86_64-linux-gnu-thread-multi | |
| Work directory is /home/adam/.cpanm/work/1314969734.22227 | |
| You have make /usr/bin/make | |
| You have LWP 5.836 | |
| You have /bin/tar: tar (GNU tar) 1.23 | |
| Copyright (C) 2010 Free Software Foundation, Inc. | |
| License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. | |
| This is free software: you are free to change and redistribute it. | |
| There is NO WARRANTY, to the extent permitted by law. |