Skip to content

Instantly share code, notes, and snippets.

View ufocoder's full-sized avatar
👽
🛸

Sergey ufocoder

👽
🛸
View GitHub Profile
<script>
var detectors = [
{
src: "https://squareup.com/login?return_to=%2Ffavicon.ico",
name: "Square"
}, {
src: "https://twitter.com/login?redirect_after_login=https%3a%2f%2ftwitter.com%2ffavicon.ico",
name: "Twitter"
}, {
src: "https://www.facebook.com/login.php?next=https%3A%2F%2Fwww.facebook.com%2Ffavicon.ico%3F_rdr%3Dp",
const bracketList = '[]{}()'
const bracketNumber = bracketList.length / 2
const hasBalancedBrackets = str => {
const stack = []
let bracketOpenLastIndex = null
let bracketOpenIndex = null
let bracketCloseIndex = null
interface InjectWheels {
 public void setWheels(Wheels w);
}
interface InjectBattery {
 public void setBattery(Battery b);
}
class Car implements InjectWheels, InjectBattery {
 Wheels injectedWheels; 
renderRow : String -> Int -> Html Msg
renderRow title data =
tr []
[ td [] [ text title ]
, td
[ style
[ ( "text-align", "right" )
, ( "min-width", "5rem" )
]
]
maximum : List comparable -> Maybe comparable
type alias Book =
{ isbn : String
, title : String
, authors : List String
, copyright : Int
, edition : Maybe String
}
type alias LibraryReport =
{ numBooks : Int
class Car{
private Wheels wheel;
private Battery battery;
/*
Где-то в нашей кодовой базе мы инстанцирует объекты, требующие этот класс
Два варианта реализации внедрения зависимостей:
1. На основе конструктора
2. На основе setter-метода
*/
class Car {
private Wheels wheel = new MRFWheels();
private Battery battery = new ExcideBattery();
...
...
}
const displayItems = storeItems
.filter(filterBy(systemCriteria))
.filter(filterBy(customerCriteria))
.sort(sortBy(primaryDimension, secondaryDimension));