Skip to content

Instantly share code, notes, and snippets.

@abhayap
abhayap / headtrack.py
Last active May 6, 2024 15:52
Read Supperware head tracker and output OSC to SceneRotator
import mido
from pythonosc.udp_client import SimpleUDPClient
ip_out = '127.0.0.1'
port_out = 7000
client = SimpleUDPClient(ip_out, port_out)
def convert(msb, lsb, degrees=True):
@eonist
eonist / My_favorite_ai_coding_prompts.md
Last active May 6, 2024 15:51
My_favorite_ai_coding_prompts.md

The art of prompt coding 🦾

Visitors

Apps used: Cursor.so / github copilot chat

img

⚠️️ Before you disregard the idea of prompt coding ⚠️️ Don't! Because everyone will be prompt-coding soon enough.

This is like when humanity stopped using horses for transportation and started using cars. 🐴 👉 🚗

/* To disable the Gutenberg’s CSS loading on the front-end */
function tw_unload_files() {
wp_dequeue_style ( 'wp-block-library' );
wp_dequeue_style ( 'wp-block-library-theme' );
}
add_action( 'wp_enqueue_scripts', 'tw_unload_files', 100 );
/* To disable Elementor’s Google font */
@mrts
mrts / markdown-to-slack.py
Last active May 6, 2024 15:49
Markdown to Slack
# Translates Markdown syntax to Slack, replaces:
#
# - hyphened lists with bullet symbols
# - double bold marker asterisks `**` with single asterisk `*`
# - headers `#` with bold marker asterisks `*`
#
# Run with
#
# python markdown-to-slack.py filename.md
#
@trandaison
trandaison / starUML.md
Last active May 6, 2024 15:48
Get full version of StarUML
  • repo -> repository

  • clone -> bring a repo down from the internet (remote repository like Github) to your local machine

  • add -> track your files and changes with Git

  • commit -> save your changes into Git

  • push -> push your changes to your remote repo on Github (or another website)

  • pull -> pull changes down from the remote repo to your local machine

  • status -> check to see which files are being tracked or need to be commited

  • init -> use this command inside of your project to turn it into a Git repository and start using Git with that codebase

sp = spotipy.Spotify(
auth_manager=SpotifyOAuth(
scope="playlist-modify-private",
redirect_uri="http://example.com",
client_id=YOUR UNIQUE CLIENT ID,
client_secret= YOUR UNIQUE CLIENT SECRET,
show_dialog=True,
cache_path="token.txt"
)
)
@StagPoint
StagPoint / Morton2D.cs
Last active May 6, 2024 15:45
Represents 2D Morton Codes by interleaving two 16-bit unsigned integer values into a 32-bit unsigned integer.
// **************************************************
// EXAMPLE USAGE:
//
// // Returns a single value with arguments x and y interleaved
// var code = MortonCode2D.Interleave( 123, 456 );
//
// // Extracts the interleaved values (123 and 456) into integer variables x and y
// MortonCode2D.Deinterleave( code, out int x, out int y )
//
// **************************************************
@ardakazanci
ardakazanci / FlipCard.kt
Created April 21, 2024 10:27
Flip Card with Jetpack Compose
@Composable
fun FlipActionScreen() {
var flippedState by remember { mutableStateOf(false) }
val rotationY by animateFloatAsState(
targetValue = if (flippedState) 180f else 0f,
animationSpec = spring(
dampingRatio = Spring.DampingRatioHighBouncy,
stiffness = Spring.StiffnessVeryLow
)
)
@ardakazanci
ardakazanci / RulerView.kt
Created April 28, 2024 06:15
RulerView - Jetpack Compose
@Composable
fun RulerView(
startValue: Int,
endValue: Int,
step: Int
) {
val density = LocalDensity.current
val scrollState = rememberScrollState()
val sectionWidth = 80.dp
var sliderValue by remember { mutableFloatStateOf(0.5f) }