Skip to content

Instantly share code, notes, and snippets.

View weapp's full-sized avatar
💸

Manuel Albarran weapp

💸
View GitHub Profile
@georgekettle
georgekettle / PhlexMailerLayout.rb
Last active February 25, 2024 22:27
Phlex Mailer layout
You'll need to update the following variables:
- ENV['APP_NAME']
- ENV['COMPANY_ADDRESS']
- ENV['HOST']
Make sure you have app/assets/images/logo.svg for this line:
helpers.image_url('logo.svg')
And also update the CSS variables to match your color scheme:
:root {
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@ArturT
ArturT / main.yaml
Last active June 8, 2021 14:50
GitHub Actions CI config for Ruby on Rails project with MySQL, Redis, Elasticsearch - how to run parallel tests with Knapsack Pro https://knapsackpro.com/?utm_source=github&utm_medium=gist&utm_campaign=rails-mysql-redis-elasticsearch-on-github-actions&utm_content=sign_up See article https://docs.knapsackpro.com/2019/github-actions-ci-config-for-…
# .github/workflows/main.yaml
name: Main
on: [push]
jobs:
vm-job:
name: CI
runs-on: ubuntu-latest
@sclinede
sclinede / saga.rb
Last active March 6, 2022 06:09
Example of Full Saga implementation in Ruby (with Usage example, also)
class Saga
class << self
def with_redis; raise NotImplementedError; end
attr_accessor :cleanup_delay, :queue, :last_txid
def queue
Thread.current[:saga_queue] ||= []
end
def last_txid
@hitvoice
hitvoice / plot_confusion_matrix.png
Last active February 21, 2024 19:51
Generate matrix plot for confusion matrix with pretty annotations.
plot_confusion_matrix.png
@tomazursic
tomazursic / InfluxDB_cheatsheet.md
Last active December 24, 2021 08:46
InfluxDB cheatsheet

InfluxDB Cheatsheet

Connect to InfluxDB using the commandline:

$ influx

Create a database foo:

CREATE DATABASE foo
@aportnov
aportnov / router.ex
Last active December 12, 2018 15:45
Elixir: Compiled EEx templates in Plug application
defmodule MyModule.Router do
@moduledoc """
Http Entry Point
"""
use Plug.Router
use Plug.ErrorHandler
plug Plug.Logger
plug :match
@deanhume
deanhume / service-worker.js
Last active March 16, 2016 15:03
Register Service Worker
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js').then(function(registration) {
// Registration was successful
console.log('ServiceWorker registration successful with scope: ', registration.scope);
registration.pushManager.subscribe({userVisibleOnly: true}).then(function(subscription){
isPushEnabled = true;
console.log("subscription.subscriptionId: ", subscription.subscriptionId);
console.log("subscription.endpoint: ", subscription.endpoint);
// TODO: Send the subscription subscription.endpoint
@DorianRudolph
DorianRudolph / LICENSE.txt
Last active January 4, 2024 03:36
Arduino PS2 to USB HID Keyboard Converter
Copyright (c) 2015, Dorian Rudolph
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all