Quick way to export your Slack team's emoji (concurrently!)
- Create an API token for your Slack team
# list pid, execution time, and query text for running queries | |
def pg_ps | |
now = Time.now | |
ActiveRecord::Base.connection.execute("SELECT pid, query, query_start FROM pg_stat_activity WHERE state='active'").to_a.each do |q| | |
printf "%8d %10.2f %s\n", q['pid'], now - DateTime.parse(q['query_start']), q['query'] | |
end | |
nil | |
end | |
# cancel the current query for the given process |
# Packages reqd: pydub, ffmpeg | |
# pydub - pip install pydub | |
# ffmpeg: | |
# sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next | |
# sudo apt-get update | |
# sudo apt-get install ffmpeg | |
## Load the m4a files (in M4a_files.tar.gz) |
defmodule Default.Behaviour do | |
@moduledoc """ | |
Creates a behaviour that carries its own default implementation. | |
When used into a behaviour module, when that module in turn is used, all functions | |
defined on it are given to the using module. | |
This allows you to have concrete implementations of the behaviour's default functionality | |
for testing, unlike cramming them all into a __using__ macro. | |
Quick way to export your Slack team's emoji (concurrently!)
I certainly have plenty of ar callbacks, wondering what patterns you use to avoid controller bloat or factories for every model?
Sometimes option 1) Extract the callback to its own method and call it:
# File app/models/user.rb
class User < ApplicationRecord
- after_commit { |user| Mailer.registration_confirmation(user).deliver_later }, on: :create
+ def send_registration_confirmation
# Docker Version Manager wrapper for *nix | |
# Implemented as a POSIX-compliant function | |
# Should work on sh, dash, bash, ksh, zsh | |
# To use, source this file from your bash profile | |
begin # This ensures the entire script is downloaded | |
set DVM_SCRIPT_SOURCE $_ | |
# __dvm_has() { | |
# type "$1" > /dev/null 2>&1 |
Slack doesn't provide an easy way to extract custom emoji from a team. (Especially teams with thousands of custom emoji) This Gist walks you through a relatively simple approach to get your emoji out.
If you're an admin of your own team, you can get the list of emoji directly using this API: https://api.slack.com/methods/emoji.list. Once you have it, skip to Step 3
HOWEVER! This gist is intended for people who don't have admin access, nor access tokens for using that list.
Follow along...
// Update: Hey Folks - I've got a full Gulpfile with everything else over at https://github.com/wesbos/React-For-Beginners-Starter-Files | |
var source = require('vinyl-source-stream'); | |
var gulp = require('gulp'); | |
var gutil = require('gulp-util'); | |
var browserify = require('browserify'); | |
var reactify = require('reactify'); | |
var babelify = require('babelify'); | |
var watchify = require('watchify'); | |
var notify = require('gulp-notify'); |
package service | |
import play.api._ | |
import securesocial.core._ | |
import securesocial.core.providers.Token | |
import securesocial.core.UserId | |
import models._ | |
class SlickUserService(application: Application) extends UserServicePlugin(application) { |