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/bash | |
# clone repo from gitlab | |
# 1. copy link form the website | |
# a = [...document.querySelectorAll('.projects-list>li h2 a')].map(x=>x.href).join('\n') | |
# copy(a) | |
# 2. save to repo.txt | |
# 3. run the shell | |
# set curent directory |
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
export interface FormItem { | |
[k: string]: string | number | boolean; | |
} | |
export type NestFormItem = | |
& FormItem | |
& { | |
[k : string]: FormItem[]; | |
}; |
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
@sizes: 0, 5, 8, 10, 15, 20, 25, 30, 45; | |
@sides: { | |
l: -left; | |
r: -right; | |
t: -top; | |
b: -bottom | |
} |
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
$sizes: (5, 8, 10, 15, 20, 25, 30, 45); | |
$sides: ("l": "-left", "r": "-right", "t": "-top", "b": "-bottom"); | |
@each $size in $sizes { | |
.m#{$size} { | |
margin:#{$size}px; | |
} |
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
@echo off | |
color 02 | |
for %%I in (.) do title sync %%~nxI | |
:: set charset | |
git config --global core.quotepath false | |
git config --global gui.encoding utf-8 | |
git config --global i18n.commit.encoding utf-8 | |
git config --global i18n.logoutputencoding utf-8 | |
set LESSCHARSET=utf-8 |
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
fetch(url, { mode: "cors" }) | |
.then(function(response) { | |
return response.blob(); | |
}) | |
.then(r => { | |
let file = new FileReader(); | |
file.onload = function(e) { | |
let el = document.createElement("a"); | |
el.setAttribute("href", e.target.result); | |
el.setAttribute("download", x.urlbase.split("=")[1] + ".jpg"); |
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
// Convert hex color to RGBA color | |
// x => current item | |
// i => index | |
// o => origin value | |
const hex2rgba = h => h.replace('#','').split('').map((x,i,o)=>o.length< 6 ? [x,x]: x).flat().reduce((str,x,i,orig)=>i%2 ? str.replace("x", parseInt( orig[i-1]+ x , 16) ) + ([',',','].concat(orig.length < 7 ? [',1)']:[',',')']))[(i-1)/2] : str + 'x','rgba(') | |
// View Results | |
hex2rgba('#eeff00') | |
// > "rgba(238,255,0,1)" |