Skip to content

Instantly share code, notes, and snippets.

Avatar

Josue Zarzosa josketres

  • @eSailors
  • Hamburg, Germany
View GitHub Profile
@joseluisq
joseluisq / terminal-git-branch-name.md
Last active Oct 25, 2020
Add Git Branch Name to Terminal Prompt (Linux/Mac)
View terminal-git-branch-name.md

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
@paulirish
paulirish / what-forces-layout.md
Last active Oct 25, 2020
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@johnjohndoe
johnjohndoe / android-sdk-setup.sh
Last active Jun 12, 2019
Creating symbolic links in Android SDK folder. After Android-Studio resp. IntelliJ will work with Maven and Gradle.
View android-sdk-setup.sh
#!/bin/bash
# Author: Tobias Preuss
# Version: 2018-01-05
echo "Creating symbolic links in Android SDK folder"
echo "============================================="
echo
if [ -z "$ANDROID_HOME" ] ; then
@ischenkodv
ischenkodv / RAFPlugin.js
Created Feb 28, 2015
Jasmine plugin to test functions with requestAnimationFrame.
View RAFPlugin.js
/**
* Jasmine RequestAnimationFrame: a set of helpers for testing funcionality
* that uses requestAnimationFrame under the Jasmine BDD framework for JavaScript.
*/
;(function() {
var index = 0,
callbacks = {};
function MockRAF(global) {
@viktorklang
viktorklang / CQRS_ES_Actor.scala
Created Feb 1, 2011
CQRS and EventSourcing using Akka Actors
View CQRS_ES_Actor.scala
import scala.collection.mutable.ListBuffer
import akka.actor.{Actor,ActorRef}
import akka.actor.Actor._
import akka.routing.{ Listeners, Listen }
//Represents a domain event
trait Event
//A builder to create domain entities
trait EntityBuilder[Entity] {
@scrogson
scrogson / README.md
Last active Nov 14, 2017
Shell functions to aid in using hub(1) with GitHub Enterprise.
View README.md

I recently started working at Blue Box and we use GitHub Enterprise (GHE) for all of our apps. I had gotten in the habit of using hub to improve my git workflow and was curious if I could use hub with GHE. I turned to the docs and sure enough, you can!

The docs tell you two ways of setting up hub to use GHE:

By default, hub will only work with repositories that have remotes which point to github.com. GitHub Enterprise hosts need to be whitelisted to configure hub to treat such remotes same as github.com:

$ git config --global --add hub.host my.git.org
@ElliotChong
ElliotChong / facebookPluginDirectives.coffee
Created Oct 9, 2012
Angular directives that will parse Facebook plugins added to the DOM after Facebook has been initialized
View facebookPluginDirectives.coffee
module = angular.module 'FacebookPluginDirectives', []
createDirective = (name) ->
module.directive name, ->
restrict: 'C'
link: (scope, element, attributes) ->
FB?.XFBML.parse(element.parent()[0])
createDirective pluginName for pluginName in ['fbActivity', 'fbComments', 'fbFacepile', 'fbLike', 'fbLikeBox', 'fbLiveStream', 'fbLoginButton', 'fbName', 'fbProfilePic', 'fbRecommendations']
@FlaviuSim
FlaviuSim / .tmux.conf
Created Jun 24, 2012
Flaviu Simihaian's Tmux Conf
View .tmux.conf
# use vi mode
setw -g mode-keys vi
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# force a reload of the config file
unbind r
View .tmux.conf
# use vi mode
setw -g mode-keys vi
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# force a reload of the config file
unbind r
You can’t perform that action at this time.