- Dynamic Dispatch
- Dynamic Method
- Ghost Methods
- Dynamic Proxies
- Blank Slate
- Kernel Method
- Flattening the Scope (aka Nested Lexical Scopes)
- Context Probe
- Class Eval (not really a 'spell' more just a demonstration of its usage)
- Class Macros
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
Show hidden characters
{ | |
"presets": [ | |
"@babel/preset-env", | |
"@babel/preset-react" | |
] | |
} |
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
mod time_diff; | |
use time_diff::TimeDiff; | |
fn main() { | |
let td = TimeDiff::new(1234123); | |
let td2 = TimeDiff::new(1233); | |
println!("First diff is {}", td); | |
println!("Second diff is {}", td2); | |
println!("Sum of that diffs is {}", td + td2); |
Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !
myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
let
(a,b,c) = myTuple
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
$.ajaxSetup({ | |
beforeSend: function(xhr, settings) { | |
if (settings.type == 'POST' || settings.type == 'PUT' || settings.type == 'DELETE') { | |
function getCookie(name) { | |
var cookieValue = null; | |
if (document.cookie && document.cookie != '') { | |
var cookies = document.cookie.split(';'); | |
for (var i = 0; i < cookies.length; i++) { | |
var cookie = jQuery.trim(cookies[i]); | |
// Does this cookie string begin with the name we want? |
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
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHYAMnK0x4q12K7UqeR7sd6joJN9LgGc1d6XQhg/eOUD viktor@gentoo |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
elem.clientLeft
,elem.clientTop
,elem.clientWidth
,elem.clientHeight
elem.getClientRects()
,elem.getBoundingClientRect()
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 { | |
font-size: 5vw; | |
} | |
@media (max-width: 700px) { | |
body { | |
font-size: 35px; | |
} | |
} | |
@media (min-width: 3000px) { | |
body { |
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
# 1. trigger events | |
$(document).trigger 'flash:message', { level: 'error', message: 'There was an error' } | |
# 2. catch events in another place | |
$(document) | |
.on 'flash:message', (e, params) => | |
if params.level && params.message | |
@show params.level, params.message # call 'show' method doing something interesting :-) |
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
# English translations for Retina package. | |
# Copyright (C) 2015 THE PACKAGE'S COPYRIGHT HOLDER | |
# This file is distributed under the same license as the Retina package. | |
# FIRST AUTHOR <EMAIL@ADDRESS>, 2015. | |
# | |
msgid "" | |
msgstr "" | |
"Project-Id-Version: Retina 0.33.2-26-g8a4bb2a\n" | |
"Report-Msgid-Bugs-To: \n" | |
"POT-Creation-Date: 2015-06-01 16:37+0400\n" |
NewerOlder