Skip to content

Instantly share code, notes, and snippets.

@EricEzaM
EricEzaM / godot_ticker_smooth.gd
Last active May 3, 2024 22:48
Godot Label Scrolling/Ticker Text
# On the parent, e.g. ColorRect
# This gives this CanvasItem a "clipping mask" that only allows children to display within it's rect.
func _draw():
VisualServer.canvas_item_set_clip(get_canvas_item(), true)
# On the child (Label)
export (float) var scroll_speed = 60
func _process(delta):
rect_position.x -= scroll_speed * delta
@colorfield
colorfield / drupal8-links.php
Last active May 3, 2024 22:47
Drupal 8 links, or where is my l() function
@davidsteppenbeck
davidsteppenbeck / KeyframeView.swift
Created May 3, 2024 20:08
Keyframe Animation Example in SwiftUI
import SwiftUI
struct KeyframeValues {
var scale = 1.0
var horizontalStretch = 1.0
var verticalStretch = 1.0
var translation = 0.0
var rotation = Angle.zero
}
@mabenson00
mabenson00 / cheatsheet.rb
Last active May 3, 2024 22:40
Rails ActiveRecord JSON cheatsheet
# Basic key operators to query the JSON objects :
# #> : Get the JSON object at that path (if you need to do something fancy)
# -> : Get the JSON object at that path (if you don't)
# ->> : Get the JSON object at that path as text
# {obj, n} : Get the nth item in that object
# https://www.postgresql.org/docs/9.4/functions-json.html#FUNCTIONS-JSONB-OP-TABLE
# Date
# date before today
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active May 3, 2024 22:39
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@uucidl
uucidl / 00_the-problem-with-UI.org
Last active May 3, 2024 22:38
The Problem Of UI (User Interfaces)

Links

Note: a lot of programmers talk about UI without mentionning the user even once, as if it was entirely a programming problem. I wonder what we’re leaving off the table when we do that.

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 3, 2024 22:37
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@meeas
meeas / DebianSid_on_LUKS-BTRFS_with_systemd-boot.md
Last active May 3, 2024 22:30
For installing Debian Sid with LUKS2 encrypted BTRFS filesystem with Systemd-boot and rEFInd bootloaders plus an option for dualboot to Windows

For directly installing Debian Sid not supported by the Debian installer, namely:

  • Single LUKS2 encrypted partition which contains the full installation
  • Single BTRFS filesystem (integrated home partition)
  • Encrypted swapfile in BTRFS subvolume (supports laptop suspend but not hibernate)
  • Uses systemd-boot bootloader (instead of Grub2, also optional rEFInd instructions)
  • Minimal Gnome install (plus instructions for any other DE you wish)
  • Proper user groups for common security tools like sudo-less Wireshark, etc...
  • Optional removal of crypto keys from RAM during laptop suspend
  • Optional configurations for laptops (including fingerprint readers)
@rphlmr
rphlmr / helpers.ts
Last active May 3, 2024 22:28
Drizzle ORM, deep sub queries
/* -------------------------------------------------------------------------- */
/* More here; */
/* -------------------------------------------------------------------------- */
//gist.github.com/rphlmr/0d1722a794ed5a16da0fdf6652902b15
https: export function distinctOn<Column extends AnyColumn>(column: Column) {
return sql<Column["_"]["data"]>`distinct on (${column}) ${column}`;
}
export function jsonBuildObject<T extends SelectedFields>(shape: T) {