Skip to content

Instantly share code, notes, and snippets.

@a7madgamal
a7madgamal / dark.md
Last active July 14, 2023 04:00
Dark mode for Slack on MacOS
@danman01
danman01 / bash_prompt_customization.sh
Created March 21, 2017 01:38
bash_prompt_customization.sh
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
parse_git_dirty() {
st=$(git status 2>/dev/null | tail -n 1)
if [[ $st == "" ]]; then
echo ''
elif [[ $st == "nothing to commit (working directory clean)" ]]; then
echo ''
@BenGitsCode
BenGitsCode / es6-epic-logging.js
Created February 8, 2017 17:11
Great way to log objects with <the thing is: the thing>
`console.log({min});`
// it will output with the variable name like this `Object {min: 46}`
@v
v / index.html
Created January 18, 2017 19:10
Exported from Popcode. Click to import: https://popcode.org/?gist=5100680d0c69ca6fd4f3096b4f5e88db
<!DOCTYPE html>
<html>
<head>
<title>Do Now - Manipulating HTML</title>
</head>
<body>
<!-- exercise 1 -->
<div id="ex1" class="exercise">
@tduarte
tduarte / publish-ghpages.md
Last active May 18, 2024 13:52
If you need to force push an subtree
git checkout master # you can avoid this line if you are in master...
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages # delete the local gh-pages because you will need it: ref
@nweddle
nweddle / agnoster-newline.zsh-theme
Created March 11, 2016 21:25
Agnoster ZSH Theme with New Line
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline
@ericelliott
ericelliott / gitclean.sh
Created January 31, 2016 04:57
gitclean.sh - cleans merged/stale branches from origin
git remote prune origin
git branch -r --merged master | egrep -iv '(master|develop)' | sed 's/origin\///g' | xargs -n 1 git push --delete origin
@gvvaughan
gvvaughan / gnosis.zsh-theme
Created August 23, 2015 13:16
A colorful multi-line oh-my-zsh theme with git status etc.
# Some colors
# -----------
# Expand these right away, to minimise cycles spent expanding every prompt!
# You can override these before loading the theme.
: ${GNOSIS_C1="%{$reset_color$fg[blue]%}"}
: ${GNOSIS_C2="%{$reset_color$fg_bold[green]%}"}
: ${GNOSIS_C3="%{$reset_color$fg[cyan]%}"}
: ${GNOSIS_ACCENT1="%{$reset_color$fg[yellow]%}"}
: ${GNOSIS_ACCENT2="%{$reset_color$fg_bold[white]%}"}
: ${GNOSIS_STANDOUT="%{$fg_bold[red]%}"}
// Test
{
// TEST
// TEST
// TEST
/* TEST */
# TEST
}
/* TEST */
@nolanlawson
nolanlawson / protips.js
Last active February 4, 2024 18:06
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");