Skip to content

Instantly share code, notes, and snippets.

View grammaticof's full-sized avatar

Francesco Grammatico grammaticof

View GitHub Profile
@eproxus
eproxus / README.md
Last active May 30, 2023 08:19 — forked from raysegantii/README.md
Use Bootstrap 4 SASS with Phoenix

Versions

  • Bootstrap 4 Alpha 6
  • Phoenix 1.2.1

Instructions

  1. Install npm packages

npm install --save-dev sass-brunch

@bitwalker
bitwalker / config.ex
Created July 19, 2016 23:00
Useful config wrapper for Elixir
defmodule Config do
@moduledoc """
This module handles fetching values from the config with some additional niceties
"""
@doc """
Fetches a value from the config, or from the environment if {:system, "VAR"}
is provided.
An optional default value can be provided if desired.
@davidtron
davidtron / transcode-toh264.md
Last active January 19, 2024 12:22
Transcode h265 down to h264 on OSX using ffmpeg
  • Install brew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Install ffmpeg with h265 and h264 libraries
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265 --with-x264
  • I want to transcode the video from h265 to h264 and copy the audio stream without re-encoding, there's multiple streams in the source mkv
@TrevorS
TrevorS / fix.sh
Created April 28, 2015 22:49
fix permissions in a Rails application
find . -type f ! -path "./.git/*" ! -path "./bin/*" -perm 755 -exec chmod 644 {} \;
@honkskillet
honkskillet / byte-sizetuts.md
Last active July 18, 2024 08:32
A series of golang tutorials with youtube videos.
@luxerama
luxerama / grape_log_request_subscriber.rb
Last active December 12, 2016 15:31
Grape Log Instrumentation
class GrapeRequestLogSubscriber < ActiveSupport::LogSubscriber
def grape_controller(event)
request = Rack::Request.new(event.payload).env
response = Rack::Response.new(event.payload)
data = extract_request(request)
data.merge! extract_status(response)
logger.send(:warning, data.to_json)
end
@rastasheep
rastasheep / keyrepeat.shell
Last active January 1, 2020 20:09 — forked from kconragan/keyrepeat.shell
Enable key repeat in Apple Lion for Atom in Vim mode
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Atom if you're running vim mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@maxim
maxim / rails_load_path_tips.md
Last active April 13, 2023 13:28
How to use rails load paths, app, and lib directories.

In Rails 3

NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths

If you add a dir directly under app/

Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.

If you add a dir under app/something/

@machty
machty / router-facelift-guide.md
Last active July 10, 2024 15:14
Guide to the Router Facelift

Ember Router Async Facelift

The Ember router is getting number of enhancements that will greatly enhance its power, reliability, predictability, and ability to handle asynchronous loading logic (so many abilities), particularly when used in conjunction with promises, though the API is friendly enough that a deep understanding of promises is not required for the simpler use cases.

@machty
machty / new-router-examples.md
Last active April 16, 2020 22:03
How to do cool stuff with the new Router API