Skip to content

Instantly share code, notes, and snippets.

const apiEndpoint = "https://api.spotify.com/v1";
const authEndpoint = "https://accounts.spotify.com/api/token";
const clientId = "your client id";
const clientSecret = "your client secret";
const method = "album";
const queryParams = `?q=${encodeURIComponent(
"Pink Floyd - The wall" // query here
)}&type=${method}&limit=1`;
const searchUrl = `${apiEndpoint}/search${queryParams}`;
@Dog
Dog / gist:272225a5b22a393d2088
Last active May 4, 2024 05:48
Converting between Javascript date and Python datetime with bson
from bson.tz_util import utc
from datetime import datetime, timedelta
# This file is to impliment date related helper functions
#
# This is mainly needed because bson uses the javascript date class.
# The javascript Date() class represents timestamps in milliseconds.
# For some documentation on how Bson, Json, and Date work together, refer to:
# http://blog.mongohq.com/from-json-to-bson-and-back/
#
@ardakazanci
ardakazanci / Bar.kt
Created April 24, 2024 15:49
Bar with JetpackCompose
data class BarDataM(val value: Float, val label: String)
@Composable
fun BarChartComponent(
bars: List<BarDataM>,
barWidth: Dp,
spaceBetweenBars: Dp,
animateChart: Boolean
) {
var selectedBar by remember { mutableIntStateOf(-1) }
@dkasak
dkasak / xdg.vim
Last active May 4, 2024 05:45 — forked from kaleb/XDG.vim
vim XDG Base Directory support
" XDG Environment For VIM
" =======================
"
" References
" ----------
"
" - http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables
" - http://tlvince.com/vim-respect-xdg
" - https://gist.github.com/kaleb/3885679 (the original version)
"
@antonfrancisjeejo
antonfrancisjeejo / index.css
Created February 5, 2024 17:27
For three.js portfolio
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&family=Work+Sans:wght@100;200;300;400;500;600;700;800;900&display=swap");
@tailwind base;
@tailwind components;
@tailwind utilities;
:root {
--blue-rgb: 237 245 255;
--green-rgb: 125 161 35;
}
@russellsamora
russellsamora / us_county_latlng.csv
Last active May 4, 2024 05:42
US counties with fips code, name, and lat lng
fips_code name lng lat
01059 Franklin -87.843283 34.44238135
13111 Fannin -84.31929617 34.86412558
19109 Kossuth -94.20689787 43.20413984
40115 Ottawa -94.81058917 36.83587796
42115 Susquehanna -75.80090451 41.82127676
40053 Grant -97.78493404 36.79651364
31029 Chase -101.6979407 40.52371008
29213 Taney -93.04127586 36.65473646
32510 Carson City -119.7473502 39.15108405
@nyancodeid
nyancodeid / README.md
Last active May 4, 2024 05:41
Make RESTful API with Google Apps Script and SpreadSheet

Google Script CRUD

By Ryan Aunur Rassyid

Simply create RESTful API with Google Script and store it to Google SpreadSheet like a Pro.

@veekaybee
veekaybee / normcore-llm.md
Last active May 4, 2024 05:37
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@safaorhan
safaorhan / uninstall-youtube.txt
Created July 6, 2023 06:28
How to uninstall YouTube app via adb
The first command uninstalls updates and clears data.
The second command uninstalls the system app all together.
Run commands in this order to get rid of YouTube forever.
--
adb uninstall com.google.android.youtube
adb shell pm uninstall --user 0 com.google.android.youtube
import SwiftUI
struct SqureFlowView: View {
@StateObject private var holder = SquresHolder()
var body: some View {
TimelineView(.animation) { timeline in
Canvas { context, size in
holder.update(at: timeline.date, in: size)
for item in holder.squre {