Skip to content

Instantly share code, notes, and snippets.

View montekaka's full-sized avatar

Josh Chen montekaka

View GitHub Profile
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
@mkwsra
mkwsra / list-of-all-font-awesome-icons.php
Created November 28, 2019 18:09
List of All Font awesome icons for developers
<?php
return [
"fas fa-ad" => "Ad",
"fas fa-address-book" => "Address book",
"fas fa-address-card" => "Address card",
"fas fa-adjust" => "Adjust",
"fas fa-air-freshener" => "Air freshener",
"fas fa-align-center" => "Align center",
"fas fa-align-justify" => "Align justify",
@arefaslani
arefaslani / direct_uploads_controller.rb
Last active January 14, 2024 07:08
Active Storage's direct uploads controller
# frozen_string_literal: true
# Creates a new blob on the server side in anticipation of a direct-to-service upload from the client side.
# When the client-side upload is completed, the signed_blob_id can be submitted as part of the form to reference
# the blob that was created up front.
class ActiveStorage::DirectUploadsController < ActiveStorage::BaseController
skip_before_action :verify_authenticity_token, :only => [:create]
def create
blob = ActiveStorage::Blob.create_before_direct_upload!(blob_args)
@greyscaled
greyscaled / README.md
Last active September 19, 2022 08:59
Sequelize + Express + Migrations + Seed Starter
@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active March 1, 2024 14:39
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@jylopez
jylopez / stripe_currency_codes.js
Last active August 26, 2023 12:14
Stripe Currency Codes
[
{currency: 'Afghan Afghani', code: 'AFN'},
{currency: 'Albanian Lek', code: 'ALL'},
{currency: 'Algerian Dinar', code: 'DZD'},
{currency: 'Angolan Kwanza', code: 'AOA'},
{currency: 'Argentine Peso', code: 'ARS'},
{currency: 'Armenian Dram', code: 'AMD'},
{currency: 'Aruban Florin', code: 'AWG'},
{currency: 'Australian Dollar', code: 'AUD'},
{currency: 'Azerbaijani Manat', code: 'AZN'},

Get/set ID3 meta tags using ffmpeg

A quick guide on how to read/write/modify ID3 metadata tags for audio / media files using ffmpeg.

FFmpeg has a free-form command line option that allows the user to specify key-value-pairs for encoding metadata. Let's take a look.

1. Read ID3 metadata

To list all global metadata tags for a media file, just set an input but no output file.

@DaniSancas
DaniSancas / neo4j_cypher_cheatsheet.md
Created June 14, 2016 23:52
Neo4j's Cypher queries cheatsheet

Neo4j Tutorial

Fundamentals

Store any kind of data using the following graph concepts:

  • Node: Graph data records
  • Relationship: Connect nodes (has direction and a type)
  • Property: Stores data in key-value pair in nodes and relationships
  • Label: Groups nodes and relationships (optional)
@fidelisrafael
fidelisrafael / nginx_parser_log.rb
Last active November 17, 2019 08:45
Nginx Logger Parser for Ruby
require 'pry'
require 'json'
require 'uri'
module Application
class NginxLogParser
DEFAULT_FORMAT_REGEXP = /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s?\-\s?-\s?\[(\d{2}\/[a-z]{3}\/\d{4}:\d{2}:\d{2}:\d{2} (\+|\-)\d{4})\]\s?\\?"?(GET|POST|PUT|HEAD|DELETE|OPTIONS)\s?(.*?)\s(HTTP\/\d\.\d)\\?"?\s?(\d{3})\s?(\d+)\s?\\?\"\-\\?\"\s?\\?\"(.*?)\"/i
REQUEST_FORMAT = [
@bouchard
bouchard / config.rb
Last active December 26, 2017 05:43
Podcast XML/Builder Template for Middleman
page '/podcast.xml', layout: false
# Methods defined in the helpers block are available in templates
helpers do
def podcast_source_path(article)
"source/audio/#{article.data.file}"
end
end