Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Spaceghost's full-sized avatar
👻
Building distributed and decentralized systems that run in the browser

Johnneylee Jack Rollins Spaceghost

👻
Building distributed and decentralized systems that run in the browser
View GitHub Profile
@westonganger
westonganger / postgresql_fdw_with_activerecord_and_rails.md
Last active November 16, 2023 04:25
Postgresql FDW with ActiveRecord and Rails

Source Article (See for latest changes): https://westonganger.com/posts/using-postgresql-fdw-with-activerecord-and-rails

If you want to do some cross database joins or includes across postgresql databases regardless of local or remote databases you can use Postgres FDW. Its an awesome tool for the job when you want to avoid data replication.

Base Postgresql FDW Model:

class PostgresFdwBase < ApplicationRecord

  ### Article to familiarize with concepts in this models methods - https://thoughtbot.com/blog/postgres-foreign-data-wrapper
@htruong
htruong / template.js
Last active July 26, 2021 05:20
Zenreader server
export default (title, content) => `
<html>
<head>
<title>${title}</title>
<link
rel="stylesheet"
href="//cdn.jsdelivr.net/combine/npm/purecss@2.0.3/build/base-min.css,npm/purecss@2.0.3/build/grids-min.css,npm/purecss@2.0.3/build/forms-min.css"
/>
<style>
img {
@startergo
startergo / How to Show & Verify Code Signatures for Apps in Mac OS X
Created January 3, 2021 18:07
How to Show & Verify Code Signatures for Apps in Mac OS X
How to Show & Verify Code Signatures for Apps in Mac OS X
wget -c "https://boot.netboot.xyz/ipxe/netboot.xyz.lkrn" -O /boot/netboot.xyz.lkrn && \
cat > /etc/grub.d/40_custom <<EOF
#!/bin/sh
exec tail -n +3 \$0
menuentry 'netboot.xyz' {
set root='hd0,msdos1'
linux16 /netboot.xyz.lkrn
}
EOF
update-grub
@minhajuddin
minhajuddin / ticker.ex
Created November 29, 2016 13:32
A simple GenServer to do some work every few seconds
# Ticker
defmodule Ticker do
use GenServer
def start_link(%{module: module, function: function, interval: interval} = state)
when is_atom(module) and is_atom(function) and is_integer(interval) and interval > 0 do
GenServer.start_link(__MODULE__, state)
end
def init(state) do
# this contains development overrides
version: "3.5"
# common for app/sidekiq
# we volume bundler so we aren't constantly re-installing gems
x-app: &app-common
build:
context: .
target: dev
volumes:
@dreamcat4
dreamcat4 / how to install entware on ARM.md
Last active April 14, 2023 05:07
Install entware on ARM based router eg tomato / ddwrt / asus-merlin cfw
@nolanlawson
nolanlawson / rant.md
Last active March 1, 2023 23:34
Misconceptions about PouchDB

Misconceptions about PouchDB

A quick rant.

  1. PouchDB is slow, because it doesn't use bare-metal IndexedDB

OK, first off I want to point out the CanIUse table for IndexedDB. Go ahead, look at it. I'll wait.

class UserCreator
def initialize(listener)
@listener = listener
end
def create(attributes)
user = User.new(attributes)
if user.save
# send email
@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active April 2, 2024 14:57
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook