Skip to content

Instantly share code, notes, and snippets.

View ygkn's full-sized avatar
A believing heart is your magic.

YAGITA Yugo ygkn

A believing heart is your magic.
View GitHub Profile
class Solution:
def convert(self, s: str, numRows: int) -> str:
if numRows == 1:
return s
rows = [""] * numRows
for i, c in enumerate(s):
row_index = i % ((numRows - 1) * 2)
if row_index >= numRows - 1:
@ygkn
ygkn / IN_CASE_OF_EMERGENCY.sh
Last active May 15, 2021 10:24
IN CASE OF EMERGENCY
# 変更を全て add し commit
git commit -a -m "[skip ci] WIP: commit due to emergency"
# リモートの wip-ブランチ名-コミットハッシュブランチに push
git push origin $(git symbolic-ref --short HEAD):wip-$(git symbolic-ref --short HEAD)-$(git rev-parse HEAD)
JSON.stringify(
[undefined, "maskable"].flatMap((purpose) =>
[72, 96, 120, 128, 144, 152, 180, 192, 384, 512].map((s) => ({
src: `/icons/app-icon${
purpose === "maskable" ? "--maskable" : ""
}-${s}.png`,
sizes: `${s}x${s}`,
type: "image/png",
purpose
}))
@ygkn
ygkn / puipui.svg
Created January 23, 2021 12:38
ぷいぷい
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ygkn
ygkn / Auth0AmplifyConnector.tsx
Last active July 11, 2020 03:28
Auth0 と Amplify を連携。 https://docs.amplify.aws/lib/auth/advanced/q/platform/js#federate-with-auth0 このコードはimportしてないので動きません。
const Auth0AmplifyConnector: React.FC = () => {
const { user, getIdTokenClaims, isAuthenticated, logout } = useAuth0();
useEffect(() => {
const callback = async () => {
const currentAmplifyUser = await Auth.currentAuthenticatedUser().catch(
() => undefined
);
// auth state not changed.
/* ==UserStyle==
@name gaming manaba
@namespace github.com/openstyles/stylus
@version 1.0.0
@description make gaming manaba+R
@author Me
==/UserStyle== */
@-moz-document domain("ct.ritsumei.ac.jp") {
@keyframes gaming {
0% {
@ygkn
ygkn / manaba+R+dark.user.css
Last active October 30, 2020 07:44
darken manaba+R
/* ==UserStyle==
@name manaba+R+dark
@namespace github.com/openstyles/stylus
@version 1.0.0
@description darken manaba+R
@author ygkn
==/UserStyle== */
@-moz-document domain("ct.ritsumei.ac.jp") {
html {
filter: invert(1) hue-rotate(180deg);
test:
echo $(HOME)