Skip to content

Instantly share code, notes, and snippets.

View cathandnya's full-sized avatar

nya cathandnya

View GitHub Profile
@cathandnya
cathandnya / LazyRowPager.kt
Created March 13, 2023 00:31
LazyRowPager
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun LazyRowPager(
modifier: Modifier = Modifier,
listState: LazyListState = rememberLazyListState(),
onChangeCurrentIndex: ((Int) -> Unit)? = null,
contentPadding: Dp = 0.dp,
itemSpacing: Dp = 0.dp,
content: LazyListScope.(Dp) -> Unit,
) {
@cathandnya
cathandnya / twitter_user_lookup.dart
Last active July 1, 2022 04:39
users/lookup with dart_twitter_api
Future<List<User>> twitterLookup({
required TwitterApi twitter,
List<String>? screenNames,
List<String>? userIds,
}) async {
var params = <String, String>{};
if (screenNames != null) {
params['screen_name'] = screenNames.join(",");
}
if (userIds != null) {
#!/bin/zsh
FFMPEG="/usr/local/bin/ffmpeg"
WAIFU="/usr/local/bin/waifu2x"
INPUT=$1
OUTPUT=$2
ID=`/usr/bin/uuidgen`
WORKDIR="/tmp/$ID"
#!/bin/zsh
# anaconda
source ~/opt/anaconda3/etc/profile.d/conda.sh
conda activate tecog
pip3 install -r requirements.txt
FFMPEG="/usr/local/bin/ffmpeg"
PYTHON="/usr/local/bin/python3"
@cathandnya
cathandnya / keymap.c
Last active August 16, 2021 08:11
QMK Keymap for Keyboard Quantizer with Varmilo VA73M
/* Copyright 2020 sekigon-gonnoc
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//
// ParallaxHeaderView.swift
//
// Created by nya on 2021/03/19.
//
import SwiftUI
import MXParallaxHeader
class ParallaxViewController: MXScrollViewController, MXScrollViewDelegate {
@cathandnya
cathandnya / make-xcframework.sh
Created January 4, 2021 08:51
make-xcframework.sh
if [ $# -ne 3 ]; then
if [ $# -ne 2 ]; then
echo "usage: make-xcframework PROJECT SCHEME PRODUCT_NAME"
else
PROJECT=$1
SCHEME=$2
PRODUCT_NAME=$2
fi
else
PROJECT=$1
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* ,-----------------------------------------------------------------------------------------.
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace |
* |-----------------------------------------------------------------------------------------+
* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
* |-----------------------------------------------------------------------------------------+
* | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
@cathandnya
cathandnya / SendMail.swift
Created July 23, 2019 05:36
send mail via MailCore2
import Foundation
struct SendMail {
static let HOSTNAME = "smtp.gmail.com"
static let PORT: UInt32 = 465
static let USERNAME = "HOGEHOGE@gmail.com"
static let PASSWORD = "PASSWORD"
static let FROM = "HOGEHOGE@gmail.com"
import Cocoa
class AutoGrowingTextField: NSTextField {
override var intrinsicContentSize: NSSize {
let size = super.intrinsicContentSize
var r = frame
r.size.height = 10000
if let h = cell?.cellSize(forBounds: r).height {
return NSSize(width: size.width, height: h)