Skip to content

Instantly share code, notes, and snippets.

View bjeanes's full-sized avatar
🕊️

Bo Jeanes bjeanes

🕊️
View GitHub Profile
@psu
psu / logseq-config-default-queries.edn
Last active May 5, 2023 10:51
logseq-config-default-queries.edn
;; Logseq Default Query 6-pack
;; ---------------------------
;;
;; Pontus Sundén (@psu)
;; October 28, 2022
;;
;; Attribution
;; - https://gist.github.com/sawhney17/3a1b04936f35df80253431a61cb74737
;;
;; ---------------------------

⭐ This post is best experienced in my blog: https://ricostacruz.com/posts/javascript-in-rails-7

JavaScript in Rails 7

JavaScript in Rails 7 will be different: Webpacker is retired, and there are 2 new gems to manage frontend files.

Situation

  • 🛌 Webpacker is retired — Webpacker 5 will be the last version, as announced on Jan 2022. The Webpacker 6 release candidate is now going to be community-maintained under a new name. (github.com: webpacker readme)
@LukeChannings
LukeChannings / WtFnZb-Renamer.py
Created February 13, 2022 20:21
WtFnZb-Renamer.py
#!/usr/bin/env python3
### NZBGET SCAN SCRIPT
# Extract filenames from subjects containing [PRiVATE]-[WtFnZb]
#
# This extensions extracts obfuscated filenames from .nzb files
# created by WtFnZb.
#
# Supported subject formats:
#
import zipfile
import getopt
import sys
import re
import json
import codecs
opts, unparsedArgs = getopt.getopt(sys.argv[1:], "f:")
zipFileName = None
@soshial
soshial / freematics.md
Last active March 15, 2024 11:57
Freematics + Traccar (integration and configuration)

In this article I listed some common problems I encountered when I tried to use Freematics OBD-reader together with traccar device-tracking server. Both are open-source, thanks to which I was able to improve both and their cooperation.

Freematics: official repo and my fork.

traccar: official repo and my fork.

What are the pitfalls and hardware drawbacks of Freematics?

  1. Currently, Freematics cannot switch between WiFi and SIM depending on connectivity. If you want to switch to a different WiFi or mobile operator - you need to open your bloody Windows and recompile everything :)
  2. Doesn't work at all without external power, has no battery. Works only when connected to USB (3.7V), OBD-II (12V), or SAE J1939 (24V). It me
@bjeanes
bjeanes / AAA_uuid_generate_v6mc.sql
Last active July 22, 2022 00:27
Postgres UUIDv6 (non-standard)
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
-- My port of https://github.com/kurttheviking/uuid-with-v6-js
-- A hacky translation of:
-- - http://gh.peabody.io/uuidv6/
-- - https://tools.ietf.org/html/draft-peabody-dispatch-new-uuid-format
CREATE OR REPLACE FUNCTION uuid_v1_to_v6(v1 uuid)
RETURNS uuid AS $$
DECLARE
v6 text;
@itsanov
itsanov / fix_sketchup_wine.rb
Last active July 14, 2023 11:33 — forked from DSDev-NickHogle/fix_sketchup_wine.rb
Helps fix the one-frame delay problem when running Google Sketchup in Wine
# Fixes the view each time the view changes
require 'sketchup'
def refresh
UI.start_timer(0, false) {
Sketchup.active_model.active_view.invalidate.refresh
}
end
@ProGM
ProGM / arel_cheatsheet_on_steroids.md
Last active April 19, 2024 04:06
Arel cheatsheet on Steroids

Arel Cheatsheet on Steroids

A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.

Tables

posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord

Table alias

@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@christopherlai
christopherlai / Dockerfile
Created September 16, 2019 22:57
Example Dockerfile for Elixir 1.9.1 umbrella project
FROM elixir:1.9.1-alpine as build
ENV MIX_ENV=prod
WORKDIR /build
RUN apk add --no-cache build-base nodejs yarn && \
mix local.hex --force && \
mix local.rebar --force