Skip to content

Instantly share code, notes, and snippets.

View john-evangelist's full-sized avatar

Evangelista john-evangelist

View GitHub Profile
@cobyism
cobyism / gh-pages-deploy.md
Last active March 12, 2025 14:45
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@subchen
subchen / Install Ubuntu 14.4.md
Last active February 27, 2021 18:34
Install Ubuntu 14.4
  1. install virtualbox-guest-dkms for ubuntu 64bit (解决分辨率问题)
sudo apt-get install virtualbox-guest-dkms
sudo reboot
  1. remove libreoffice
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
# Utilize-o em 'config/locales/', com o nome de 'devise.pt-BR.yml'.
# Em 'config/application.rb', utilize => config.i18n.default_locale = :'pt-BR'
pt-BR:
devise:
confirmations:
confirmed: "Sua conta foi confirmada com sucesso."
send_instructions: "Você receberá um e-mail para confirmar sua conta em alguns minutos."
@bradwilson
bradwilson / append-path.ps1
Last active March 4, 2020 19:09
Add VS 2015 build tools to your path
param(
[Parameter(Mandatory=$true)][string]$pathToBeAdded
)
$local:oldPath = get-content Env:\Path
$local:newPath = $local:oldPath + ";" + $pathToBeAdded
set-content Env:\Path $local:newPath
# zsh
EMOJI=(💩 🐦 🚀 🐞 🎨 🍕 🐭 👽 ☕️ 🔬 💀 🐷 🐼 🐶 🐸 🐧 🐳 🍔 🍣 🍻 🔮 💰 💎 💾 💜 🍪 🌞 🌍 🐌 🐓 🍄 )
function random_emoji {
echo -n "$EMOJI[$RANDOM%$#EMOJI+1]"
}
PROMPT="$(random_emoji) "
RPROMPT='%c'
@voxxit
voxxit / USING-VAULT.md
Last active July 7, 2022 03:02
Consul + Vault + MySQL = <3
git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200

Initializing a vault:

vault init
@kciesielski
kciesielski / freemonads.scala
Last active April 12, 2019 00:09
Free Monads example
package com.softwaremill.freemonads
import cats.free.Free
import cats.~>
import cats._, cats.std.all._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
sealed trait External[A]
case class Tickets(count: Int) extends AnyVal
@vasanthk
vasanthk / System Design.md
Last active March 13, 2025 21:04
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@guidomedina
guidomedina / MpscBoundedMailbox.java
Last active November 5, 2018 19:27
MpscBoundedMailbox
import akka.actor.ActorRef;
import akka.dispatch.*;
import org.jctools.queues.MpscArrayQueue;
/**
* Non-blocking, multiple producer, single consumer high performance bounded message queue,
* this implementation is similar but simpler than LMAX disruptor.
*/
public final class MpscBoundedMailbox implements MessageQueue {
@mattbarackman
mattbarackman / Type_Families_Sealed_Traits_and_Exhaustive_Pattern_Matching_in_Scala.md
Last active August 25, 2020 01:08
A brief lesson on Type Families, Sealed Traits, and Exhaustive Pattern Matching in Scala

Scala: Type Families, Sealed Traits, and Exhaustive Pattern Matching

By: Matt Barackman

What is a Type Family?

A collection of objects or case classes that share a sealed trait.

In the example below, the type family would be a collection of traffic light colors with Red, Yellow, and Green as member objects.