curl https://gist.githubusercontent.com/kinncj/1de6b1c030f18a49531547068da7152e/raw/4725d0c9f174d022bf2dd56466b92c73e9f053b8/generate.sh | $SHELL
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
#!/bin/env python3 | |
import leglight | |
import click | |
allLights = leglight.discover(2); | |
light = allLights[0]; | |
__author__ = "kinncj" | |
@click.group() |
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
(function(){ | |
// Run at console from the Stale Branches tab. | |
var rawForms = document.querySelectorAll('.js-branch-destroy > button'), | |
forms = Array.from(rawForms); | |
console.log(forms); | |
forms.forEach(function(form){ | |
console.log(form.click()); | |
}); | |
})(); |
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
# ~/.bash_profile | |
# ... | |
# Docker cleanup | |
dcleanup(){ | |
docker rm -v $(docker ps --filter status=exited -q 2>/dev/null) 2>/dev/null | |
docker rmi $(docker images --filter dangling=true -q 2>/dev/null) 2>/dev/null | |
} | |
# Git cleanup | |
gitcleanup() { |
- Sorting:
- Bubble, or sinking sort
- Seeks for the lowers value, swaps in the inner level
- Means that every iteration would swap values
- Seeks for the lowers value, swaps in the inner level
- Selection:
- Seeks for the lowest value, swaps only when found AT the outter level
- Means that not all iteration would swap values
- Seeks for the lowest value, swaps only when found AT the outter level
- Bubble, or sinking sort
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
<?php | |
class FileObject extends \SplFileObject | |
{ | |
private $size; | |
public function fwrite($content, $len = null) // :int | |
{ | |
$this->size = $len ?: strlen($content); |
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
<?php | |
SuaPlatform extends MySQLWHateverPlatform | |
{ | |
/** .. **/ | |
public function getDefaultValueDeclarationSQL($field) | |
{ | |
$default = parent::getDefaultValueDeclarationSQL($field); | |
$this->decorateDatetime($field, $default); |
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
<?php | |
class Node | |
{ | |
private $left; | |
private $right; | |
public function __construct(Node $left = null, Node $right = null) | |
{ | |
$this->left = $left; |
NewerOlder