Instantly share code, notes, and snippets.

View Material-theme-default.json
{
"name": "Material-Theme-Default",
"type": "dark",
"tokenColors": [
{
"settings": {
"background": "#263238",
"foreground": "#C3CEE3"
}
},
View commit-emoji.md

Git Commit Message

All Git Commit Messages MUST meet with this Text Format:

:emoji: Subject
(Only One NewLine)
Message Body
(Only One NewLine)
Ref <###>
View charactermap.php
<?php
$characterMap = [
'ð' => 'th', 'Ð' => 'Th', 'Þ' => 'Th', 'þ' => 'th', 'đ' => 'd',
'Ƿ' => 'W', 'ƿ' => 'w', 'Ȝ' => 'G', 'ȝ' => 'g', 'æ' => 'ae',
'Æ' => 'AE'
];
View google_api.php
<?php
// If is set book ISBN we can try search in Google API
if ($book['isbn']) {
$isbn = preg_replace("/[^A-Za-z0-9 ]/", '', $book['isbn']);
$googleBooks = callApi("GET", "https://www.googleapis.com/books/v1/volumes", [
"q" => "isbn:".$isbn,
"key" => config('library.books_api_key')
]);
View _mixins.scss
// Simple transition mixin with all browser coverage
@mixin transitions($transitions...) {
-webkit-transition: $transitions;
-moz-transition: $transitions;
-ms-transition: $transitions;
-o-transition: $transitions;
transition: $transitions;
}
// Add columns to paragraph
View stuf_hp.lua
function(unit, cache, textframe)
local curhp, maxhp = UnitHealth("target"), UnitHealthMax("target")
if curhp ~= maxhp then
if maxhp >= 1000000 then
return "%.2fM / %.2fM", curhp / 1000000, maxhp / 1000000
elseif maxhp >= 1000 then
return "%.2fK / %.2fK", curhp / 1000, maxhp / 1000
else
return "%s / %s", curhp, maxhp
end