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
body:before { | |
content: ""; | |
position: fixed; | |
top: -10px; | |
left: 0; | |
width: 100%; | |
height: 10px; | |
-webkit-box-shadow: 0px 0px 10px rgba(0,0,0,.8); | |
-moz-box-shadow: 0px 0px 10px rgba(0,0,0,.8); | |
box-shadow: 0px 0px 10px rgba(0,0,0,.8); |
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 Main where | |
{-| | |
We use a 'Data.Char' here. Who ever needs to convert | |
to snake_case or CamelCase unicode strings?.. | |
-} | |
import Data.Char (toUpper, toLower, isUpper) | |
----------------------------------------------------------------------------- |
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
----------------------------------------------------------------------------- | |
{-| Split a 'String', by specified predicate, but do not remove matched | |
characters from the result. | |
Not an efficient implementation. | |
First, it folds a 'String' to a list of Strings. | |
Elements in the resulting list are in the reversed order, because they | |
are prepended to the final list, not appended. | |
At the end, it reverses the result. |
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 Main where | |
import Data.Char (toUpper, toLower) | |
{- | POSIX Regex approach. -} | |
import Text.Regex (mkRegex, subRegex, matchRegexAll, Regex) | |
------------------------------------------------------------------------------ | |
{- | Transforms first element of the 'String' using the function given. -} | |
transformFst :: (Char -> Char) -> String -> String | |
transformFst _ "" = "" |
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.Regex (mkRegex, matchRegexAll, Regex) | |
------------------------------------------------------------------------------ | |
{- | Taken from the <http://pleac.sourceforge.net/pleac_haskell/strings.html> | |
'subRegex' allows only a fixed 'String' | |
This custom version takes a ('String' -> 'String') function to compute | |
a result. | |
The function is applied to the all matched results, which are found |
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 Main where | |
------------------------------------------------------------------------------ | |
{- | | |
First, define some example functions. | |
-} | |
------------------------------------------------------------------------------ | |
foo2 :: Int -> Int -> Int | |
foo2 a b = a + b | |
------------------------------------------------------------------------------ |
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
""" | |
A newforms widget and field to allow multiple file uploads. | |
Created by Edward Dale (www.scompt.com) | |
Released into the Public Domain | |
""" | |
from django.utils.encoding import force_unicode | |
from django.utils.datastructures import MultiValueDict | |
from django.utils.translation import ugettext |
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
/*************************************************************************** | |
Copyright (C) 2008 RadixPro/Jan Kampherbeek (http://radixpro.org). | |
This program is free software; you can redistribute it and/or | |
modify it under the terms of both the GNU General Public License (GPL). | |
You should also adhere to the terms of the Swiss Ephemerice | |
License (SEPL). | |
The GPL is published by the Free Software Foundation; either version 3 | |
of the License, or (at your option) any later version is effective. | |
The SEPL (Swiss Ephemeris License) is published by AstroDienst; either |
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.Printf (printf) | |
----------------------------------------------------------------------------- | |
{- interface: -} | |
data BaseObject = BaseObject { baseObjectA :: Int } -- the top-level object | |
class WithInheritedActions a where | |
-- inherited actions: | |
action1 :: a -> IO () | |
--action2 :: a -> Foo |
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 TypeFamilies, StandaloneDeriving #-} | |
{- anti-pattern warning -} | |
{- | |
Say, we need to "inherit" some behavior from another object. | |
Say, we also need to be able to customize overloaded actions, | |
preserving the ability of using the original action. | |
This is the one of the approaches. |
OlderNewer