Skip to content

Instantly share code, notes, and snippets.

View jarrodldavis's full-sized avatar
🏠
Working from home

Jarrod Davis jarrodldavis

🏠
Working from home
View GitHub Profile
@kevinoid
kevinoid / .bashrc
Created July 31, 2019 16:31
GnuPG pinentry script for terminal or graphical interface based on $PINENTRY_USER_DATA.
# ~/.bashrc: executed by bash(1) for non-login shells.
# If file exists (likely) copy fragment below into existing script:
# If stdin is a terminal
if [ -t 0 ]; then
# Set GPG_TTY so gpg-agent knows where to prompt. See gpg-agent(1)
export GPG_TTY="$(tty)"
# Set PINENTRY_USER_DATA so pinentry-auto knows to present a text UI.
export PINENTRY_USER_DATA=USE_TTY=1
@slashdotdash
slashdotdash / event_telemetry.ex
Created May 3, 2019 11:13
A Commanded event handler to produce `:telemetry` events for each recorded event.
defmodule Commanded.EventTelemetry do
@moduledoc """
A Commanded event handler to produce `:telemetry` events for each recorded
event.
It produces the following event:
- `[:commanded, :event, :published]`
"""
@slashdotdash
slashdotdash / telemetry.ex
Last active July 13, 2020 08:42
A Commanded middleware to instrument the command dispatch pipeline with `:telemetry` events.
defmodule Commanded.Middleware.Telemetry do
@moduledoc """
A Commanded middleware to instrument the command dispatch pipeline with
`:telemetry` events.
It produces the following three events:
- `[:commanded, :command, :dispatch, :start]`
- `[:commanded, :command, :dispatch, :success]`
- `[:commanded, :command, :dispatch, :failure]`
@andrewdelprete
andrewdelprete / webpack.config.js
Last active April 12, 2023 01:55
Webpack: Tailwind CSS + PurgeCSS Example
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require("path");
const glob = require("glob-all");
const PurgecssPlugin = require("purgecss-webpack-plugin");
/**
* Custom PurgeCSS Extractor
* https://github.com/FullHuman/purgecss
* https://github.com/FullHuman/purgecss-webpack-plugin
*/
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active May 17, 2024 09:06 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@jasongilman
jasongilman / atom_clojure_setup.md
Last active May 11, 2024 02:25
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

@immibis
immibis / gist:b3704f639440dc39a46f
Created August 17, 2015 10:23
List of Facebook app class names that are also haikus
FBActionSheet
FactoryApplication
Implementation
FBAThriftF
BAnalyticsEvent
ThriftModelConstants
FBBugReport
VideoScreenVideo
@JakeWharton
JakeWharton / gist:f50f3b4d87e57d8e96e9
Created February 7, 2015 01:59
Rise and Shine™, unlock and wake up your device automatically when you deploy from the IDE. Put this somewhere in your `src/debug/` code and run it when the application or main activity starts. Apache 2.
/**
* Show the activity over the lockscreen and wake up the device. If you launched the app manually
* both of these conditions are already true. If you deployed from the IDE, however, this will
* save you from hundreds of power button presses and pattern swiping per day!
*/
public static void riseAndShine(Activity activity) {
activity.getWindow().addFlags(FLAG_SHOW_WHEN_LOCKED);
PowerManager power = (PowerManager) activity.getSystemService(POWER_SERVICE);
PowerManager.WakeLock lock =

A small sampling of external projects initially built for Ember use but designed to be used standalone:

@samselikoff
samselikoff / future-proof.md
Last active April 21, 2023 17:14
Future-proofing your Ember 1.x code

This post is also on my blog, since Gist doesn't support @ notifications.


Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:

  • Use Ember CLI
  • In general, replace views + controllers with components
  • Only use controllers at the top-level for receiving data from the route, and use Ember.Controller instead of Ember.ArrayController or Ember.ObjectController
  • Fetch data in your route, and set it as normal properties on your top-level controller. Export an Ember.Controller, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.