Skip to content

Instantly share code, notes, and snippets.

@SahilMahadwar
SahilMahadwar / bing-wallpaper.sh
Last active April 24, 2024 05:34
You can use this script to automatically set Bing's image of the day as your wallpaper. It downloads the image and saves it to a chosen folder. It also keeps track of downloaded images using a JSON file, so it won't download the same one twice. Just set it to run on every login to keep your wallpaper fresh!
#!/bin/bash
# Fetch wallpaper from the API - https://github.com/TimothyYe/bing-wallpaper
api_url="https://bing.biturl.top/?resolution=3840&format=json&index=0&mkt=zh-CN"
response=$(curl -s "$api_url")
# Parse JSON response
start_date=$(echo "$response" | jq -r '.start_date')
end_date=$(echo "$response" | jq -r '.end_date')
image_url=$(echo "$response" | jq -r '.url')
@linearhw
linearhw / KingFisher.md
Last active April 24, 2024 05:29
KingFisher 의 기능 요약/정리

KingFisher

데이터 변환

  • Remote > Data & Image

    • URLSession delegate 의 receiveData 로부터 받은 data 를 모은 다음, UIImage(data: scale:) method 사용
  • Data > toDisk

    • data 의 header 를 읽어서 타입(PNG, JPG, GIF)을 판별
    • 위에서 만든 이미지를 다시 타입에 따라 데이터로 또 만들어 줌 (?)
@dannberg
dannberg / obsidian-people-moc.txt
Created February 19, 2024 14:47
Dann Berg's Obsidian People MOC. Uses Metabind and Dataview plugins. View full People Note system: https://dannb.org/blog/2022/obsidian-people-note-template/
[[+Home]] #MOC
```meta-bind-button
label: New People Note
hidden: false
class: ""
tooltip: ""
id: ""
style: primary
actions:
@dannberg
dannberg / obsidian-people-template.txt
Last active April 24, 2024 05:27
Dann Berg's People Template for Obsidian. Uses Dataview & Templater plugins. Should be saved as a Markdown file in Obsidian. See full tutorial for setup instructions: https://dannb.org/blog/2022/obsidian-people-note-template/
---
company:
location:
title:
email:
website:
aliases:
---
tags:: [[👥 People MOC]]
@barisuyar
barisuyar / Slider.swift
Created December 1, 2021 19:56
Complete Slider
import UIKit
final class Slider: UISlider {
private let baseLayer = CALayer() // Step 3
private let trackLayer = CAGradientLayer() // Step 7
override func draw(_ rect: CGRect) {
super.draw(rect)
setup()
@volfegan
volfegan / Neco_ Arc.txt
Created October 9, 2022 18:34
Neco Arc ASCII art
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡔⣻⠁⠀⢀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢀⣾⠳⢶⣦⠤⣀⠀⠀⠀⠀⠀⠀⠀⣾⢀⡇⡴⠋⣀⠴⣊⣩⣤⠶⠞⢹⣄⠀⠀⠀
⠀⠀⠀⠀⢸⠀⠀⢠⠈⠙⠢⣙⠲⢤⠤⠤⠀⠒⠳⡄⣿⢀⠾⠓⢋⠅⠛⠉⠉⠝⠀⠼⠀⠀⠀
⠀⠀⠀⠀⢸⠀⢰⡀⠁⠀⠀⠈⠑⠦⡀⠀⠀⠀⠀⠈⠺⢿⣂⠀⠉⠐⠲⡤⣄⢉⠝⢸⠀⠀⠀
⠀⠀⠀⠀⢸⠀⢀⡹⠆⠀⠀⠀⠀⡠⠃⠀⠀⠀⠀⠀⠀⠀⠉⠙⠲⣄⠀⠀⠙⣷⡄⢸⠀⠀⠀
⠀⠀⠀⠀⢸⡀⠙⠂⢠⠀⠀⡠⠊⠀⠀⠀⠀⢠⠀⠀⠀⠀⠘⠄⠀⠀⠑⢦⣔⠀⢡⡸⠀⠀⠀
⠀⠀⠀⠀⢀⣧⠀⢀⡧⣴⠯⡀⠀⠀⠀⠀⠀⡎⠀⠀⠀⠀⠀⢸⡠⠔⠈⠁⠙⡗⡤⣷⡀⠀⠀
⠀⠀⠀⠀⡜⠈⠚⠁⣬⠓⠒⢼⠅⠀⠀⠀⣠⡇⠀⠀⠀⠀⠀⠀⣧⠀⠀⠀⡀⢹⠀⠸⡄⠀⠀
⠀⠀⠀⡸⠀⠀⠀⠘⢸⢀⠐⢃⠀⠀⠀⡰⠋⡇⠀⠀⠀⢠⠀⠀⡿⣆⠀⠀⣧⡈⡇⠆⢻⠀⠀
⠀⠀⢰⠃⠀⠀⢀⡇⠼⠉⠀⢸⡤⠤⣶⡖⠒⠺⢄⡀⢀⠎⡆⣸⣥⠬⠧⢴⣿⠉⠁⠸⡀⣇⠀
@VermeilChan
VermeilChan / compile-aseprite-win.md
Last active April 24, 2024 05:20
Compile Aseprite from source code for Windows 11/10 x64
@zhuziyi1989
zhuziyi1989 / URL Schemes.md
Last active April 24, 2024 05:17
常用 URL Schemes 收集。

** 由于此文年事已久,可能某些URL Schemes已失效,可在评论区留言指出!(最后更新于 2024.4.16)

关于 URL Scheme 你知道多少?

iOS系统中

由于苹果的各应用都是在沙盒中,不能够互相之间访问或共享数据。但是苹果还是给出了一个可以在APP之间跳转的方法:URL Scheme。简单的说,URL Scheme就是一个可以让 APP 相互之间可以跳转的协议。每个 APP 的URL Scheme都是不一样的,如果存在一样的URL Scheme,那么系统就会响应先安装那个 APP 的URL Scheme,因为后安装的 APP 的URL Scheme被覆盖掉了,是不能被调用的。

Android系统中

@AlexandrHoroshih
AlexandrHoroshih / bindings.ts
Last active April 24, 2024 05:13
effector + history
import { matchPath, RouteProps } from "react-router";
// historyUpdated event is subscribed to history via history.listen or any other way
export const createPathMatcher = <Match = unknown>(config: {
path: string | string[] | RouteProps;
clock?: Event<any> | Store<any> | Effect<any, any>;
}) => {
return sample({
source: historyUpdated,
@realark
realark / ctriangle.cpp
Last active April 24, 2024 05:10
opengl hello triangle on c++ and common lisp
#include <iostream>
#include <string>
#include <GL/glew.h>
#include <GL/glu.h>
#include <SDL2/SDL.h>
// compile and run:
// rm csdlopengl ; gcc -o csdlopengl ctraingle.cpp -lSDL2 -lGLEW -lstdc++ -lGL && ./csdlopengl