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
myMaximumBy :: (a -> a -> Ordering) -> [a] -> a | |
myMaximumBy _ [] = undefined | |
myMaximumBy _ (x : []) = x | |
myMaximumBy f (x : xs) = | |
case f x val of | |
GT -> x | |
_ -> val | |
where val = (myMaximumBy f xs) |
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 Jammin where | |
import Data.List | |
data Fruit = | |
Peach | |
| Plum | |
| Apple | |
| Blackberry | |
deriving (Eq, Show, Ord) |
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 WordNumber where | |
import Data.List (intersperse) | |
digitToWord :: Int -> String | |
digitToWord 0 = "Zero" | |
digitToWord 1 = "One" | |
digitToWord 2 = "Two" | |
digitToWord 3 = "Three" | |
digitToWord _ = "other" |
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
<?php | |
/** | |
* @file | |
* Turn Drupal to a RESTful server, following best practices. | |
*/ | |
include_once __DIR__ . '/restful.entity.inc'; | |
include_once __DIR__ . '/restful.cache.inc'; |
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>alert('xss');</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
ALTER DATABASE pantheon CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; | |
ALTER TABLE field_data_field_feed_item_description CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | |
ALTER TABLE field_data_field_feed_item_description CHANGE field_feed_item_description_value field_feed_item_description_value longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; |
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
getHomeR :: Handler Html | |
getHomeR = do | |
blogs <- runDB | |
$ E.select | |
$ E.from $ \(blog `E.InnerJoin` author) -> do | |
E.on $ blog ^. BlogAuthor E.==. author ^. AuthorId | |
E.where_ $ author ^. AuthorId E.>. (E.val 1) -- how to get ID 1 | |
E.limit 5 | |
return | |
( blog ^. BlogId |
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
docker run --rm --name=ch -p=0.0.0.0:8484:8484 -p=0.0.0.0:2222:2222 \ | |
-p=0.0.0.0:4470:4444 -p=0.0.0.0:5920:5900 \ | |
-e SCREEN_WIDTH=1920 -e SCREEN_HEIGHT=1080 \ | |
-e VNC_PASSWORD=hola -e WITH_GUACAMOLE=true \ | |
-e SSH_PUB_KEY="$(cat ~/.ssh/id_rsa.pub)" \ | |
elgalu/selenium:v2.46.0-base1 |
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
'use strict'; | |
var Promise = require('bluebird'); | |
var exec = require('child_process').exec; | |
var fs = Promise.promisifyAll(require('fs')); | |
var git = require('git-rev'); | |
var nconf = require('nconf'); | |
var open = require('open'); | |
var path = require('path'); | |
var R = require('ramda'); |
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: | |
- curl -I http://127.0.0.1:8888/api/articles | |
- ./bin/behat SPECIFIC |