- Allow a content block to be set for head content:
- On
views/layout/base/html.haml
:- Replace all the content from inside the
head
tag withrender_content_block(@cms_page.head_content_block_with_default.try(:slug))
(where@cms_page
is an instance ofCms::PageConfiguration::PageWrapper
)
- Replace all the content from inside the
- Add
head_content_block_with_default
method toCms::PageConfiguration::PageWrapper
defined as:
def head_content_block_with_default attribute_with_default(:head_content_block) end
- On
- Add a migration that adds a
head_content_block_id
tocms_full_pages
andcms_rails_pages
This file contains 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 System.Random | |
turn :: Int -> Int -> IO () | |
turn target n = | |
do if n == target | |
then putStrLn "You win!!!" | |
else do | |
if n < target | |
then putStrLn "Too small" | |
else putStrLn "Too big" |
This file contains 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
check :: String -> String -> Char -> (Bool, String) | |
check word display c | |
= ( c `elem` word, [if x == c | |
then c | |
else y | (x,y) <- zip word display]) | |
turn :: String -> String -> Int -> IO () | |
turn word display n = | |
do if n == 0 | |
then putStrLn "You lose" |
This file contains 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 System.Random | |
starman :: Int -> IO () | |
starman n = do | |
g <- newStdGen | |
words = ["hello", "world", "haskell"] | |
word = words!!(fst (randomR (0,(length words) - 1) g)) | |
turn word ['-' | x <- word] n |
This file contains 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
Pending: (Failures listed here are expected and do not affect your suite's status) | |
1) Store Locator Mobile initial page load | |
# pending finding a fix for poltergeist not loading google maps API | |
# ./spec/features/retailers/store_locator_mobile_spec.rb:35 | |
2) Store Locator Mobile searching using the current location with no surrounding stores | |
# pending finding a fix for poltergeist not loading google maps API | |
# ./spec/features/retailers/store_locator_mobile_spec.rb:39 |
This file contains 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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
var root = 'http://jsonplaceholder.typicode.com'; | |
var options; | |
$.ajax({ | |
url: root + '/users', | |
method: 'GET', | |
async:false | |
}).then(function(data) { | |
options=data.map( u => u.username ); | |
}); |
This file contains 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
devices=Customer.collection.aggregate([ | |
{ | |
"$group" => { | |
_id: "$device_id", | |
count:{"$sum"=>1} | |
} | |
}, | |
{ | |
"$match"=>{ | |
count:{"$gte"=>3} |
This file contains 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
# colors! | |
green="\[\033[0;32m\]" | |
blue="\[\033[0;34m\]" | |
purple="\[\033[0;35m\]" | |
reset="\[\033[0m\]" | |
export GIT_PS1_SHOWDIRTYSTATE=1 | |
# '\u' adds the name of the current user to the prompt | |
# '\$(__git_ps1)' adds git-related stuff | |
# '\W' adds the name of the current directory |