Skip to content

Instantly share code, notes, and snippets.

View kyya's full-sized avatar
🚩
0x20

Undefined K kyya

🚩
0x20
View GitHub Profile
@kyya
kyya / README-Twemoji-React.md
Created December 23, 2020 06:45 — forked from chibicode/README-Twemoji-React.md
A dead simple React.js Twemoji component.

Twemoji + React

A dead simple React Twemoji component.

Requirements: twemoji

npm install --save twemoji
function getFileName {
Get-ChildItem -Name
}
[System.Console]::OutputEncoding=[System.Text.Encoding]::GetEncoding(65001)
Remove-Item alias:\curl
Remove-Item alias:\wget
# Import-Module oh-my-posh
# Set-Theme Avit
Remove-Item alias:\ls
@kyya
kyya / getTitleNative.js
Last active January 9, 2023 18:09 — forked from jbinto/getTitleNative.js
Get title from remote HTML URL - without jQuery
// Only using native browser features (no jQuery).
// Uses `fetch`, `DOMParser` and `querySelectorAll`.
const getTitle = (url) => {
return fetch(`${url}`)
.then((response) => response.text())
.then((html) => {
const doc = new DOMParser().parseFromString(html, "text/html");
const title = doc.querySelectorAll('title')[0];
return title.innerText;
{
"editor.formatOnSave": true,
"editor.fontSize": 16,
"editor.fontFamily": "'Fira Code', Monaco, mononoki, Consolas, Source Han Serif SC",
"editor.minimap.enabled": false,
"workbench.editor.openSideBySideDirection": "down",
"svelte.plugin.typescript.diagnostics.enable": false,
"editor.letterSpacing": 0.4,
"editor.lineHeight": 34,
"editor.renderLineHighlight": "all",
@kyya
kyya / updating-external-data-when-props-changes-using-promises.js
Created May 28, 2019 16:01 — forked from bvaughn/updating-external-data-when-props-changes-using-promises.js
Example for loading new external data in response to updated props
// This is an example of how to fetch external data in response to updated props,
// If you are using an async mechanism that does not support cancellation (e.g. a Promise).
class ExampleComponent extends React.Component {
_currentId = null;
state = {
externalData: null
};
@kyya
kyya / str.js
Created October 23, 2018 13:51
// 源字符串
const str1 = " abc =b\\n ;c=\\x61d;d=234;t=\\n;d=\"test;yes \";"
// 考虑 Value ε†…εŒ…ε« `\"` ζˆ– `=` ηš„
const str2 = " abc =b\\n ;c=\\x61d;d=234;t=\\n;d=\"test;yes\";g=\"\";sdsd\""
// 考虑 Value ε†…εŒ…ε«η©Ίζ Όηš„
const str3 = " abc =b\\n ;c=\\x61d;d=234;t=\\n;d=\"test;yes\";g=\"\" ; s dsd\""
const decode = function (str) {
var res = []
str.match(/(\w+[\s]*=((\".*?\")|(.*?));)/g).map(_item=>{
@kyya
kyya / emojis.json
Created August 20, 2018 13:04 — forked from oliveratgithub/emojis.json
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘§", "name": "family_mothers_two_girls", "shortname": "", "unicode": "", "html": "👩‍👩‍👧‍👧", "category": "p", "order": ""},
{"emoji": "πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦", "name": "family_mothers_children", "shortname": "", "unicode": "", "html": "👩‍👩‍👧‍👦", "category": "p", "order": ""},
{"emoji": "πŸ‘©β€πŸ‘©β€πŸ‘¦β€πŸ‘¦", "name": "family_mothers_two_boys", "shortname": "", "unicode": "", "html": "👩‍👩‍👦‍👦", "category": "p", "order": ""},
{"emoji": "πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘§", "name": "family_two_girls", "shortname": "", "unicode": "", "html": "👨‍👩‍👧‍👧", "category": "p", "order": ""},
{"emoji": "πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦", "name": "family_children", "shortname": "", "unicode": "", "html": "👨‍👩‍👧‍👦", "category": "p", "order": ""},
{"emoji": "πŸ‘¨β€πŸ‘©β€πŸ‘¦β€πŸ‘¦", "name": "family_two_boys", "shortname": "", "unicode": "", "html": "👨&zw
import re
def slugify(value):
if type(value) == str:
import unicodedata
from unidecode import unidecode
value = str(unidecode(value))
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore')
value = re.sub('[^\w\s-]', '', value.decode()).strip().lower()
return re.sub('[-\s]+', '-', value)
#!/bin/sh
export LANG=zh_CN.UTF-8
export XKL_XMODMAP_DISABLE=1
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
fcitx -d -r --enable sogou-qimpanel
exec startkde
@kyya
kyya / fw-pts2.conf
Last active July 22, 2018 13:35
转发 Journalctl ηš„ζ—₯εΏ—εˆ° tty η»ˆη«―οΌŒζ”Ύε…₯θ·―εΎ„ `/etc/systemd/journald.conf.d/`
[Journal]
FowardToConsole=yes
TTYPath=/dev/pts/2
MaxLevelConsole=info