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
if (a+3 ) { | |
a -= 3; | |
} | |
else{ | |
a*= 3 | |
} |
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
<button class="red">My Button</button> | |
<script> | |
var button = document.querySelector('button'); | |
var root = button.createShadowRoot(); | |
root.innerHTML = '<style>' + | |
':host { text-transform: uppercase; }' + | |
'</style>' + | |
'<content></content>'; | |
console.log(root.host); | |
</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
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
type Fetcher interface { | |
// Fetch returns the body of URL and | |
// a slice of URLs found on that page. |
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
sudo apt update | |
sudo apt install --install-recommends linux-generic-hwe-16.04 | |
sudo echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf | |
sudo echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf | |
sudo sysctl -p | |
sudo apt install git zsh nginx | |
sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash - | |
sudo apt install -y nodejs | |
sudo apt install software-properties-common |
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
%hide Prelude.Interfaces.(<=) | |
data Peano : Type where | |
O: Peano | |
(++): Peano -> Peano | |
total | |
(+): Peano -> Peano -> Peano | |
(+) O x = x | |
(+) ((++)x) y = (++)(x + y) |
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
trait Lazy[T[_]] { | |
type Type[X] = T[X] | |
def mk[A](thunk: () => A): T[A] | |
} | |
object LazyThunk extends Lazy[({type Thunk[X] = () => X})#Thunk] { | |
override def mk[A](thunk: () => A): () => A = thunk | |
} |
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
#include <iostream> | |
/** | |
* | |
def checksum(l: List[Int]): Int = l.reverse.zipWithIndex.map { | |
case (v, i) => v * (i + 1) | |
}.sum % 11 | |
def isValid(l: List[Int]): Boolean = l.size == 9 && checksum(l) == 0 | |
isValid(List(3, 4, 5, 8, 8, 2, 8, 6, 5)) // true |
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
#include <iostream> | |
struct MyTrait; | |
struct AnotherTrait; | |
struct YetAnotherTrait; | |
struct RubbishTrait; | |
template <class ... Traits> | |
struct MyTypeWithTrait {}; |
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
package ezksd | |
import ezksd.Parser.parse | |
object Interpreter { | |
type Continuation[T] = T => Unit | |
@inline | |
def cps_map(l: List[Any], f: (Any, Any => Unit) => Unit, k: Continuation[List[Any]]) { |
NewerOlder