Skip to content

Instantly share code, notes, and snippets.

View ahmedelgabri's full-sized avatar
🤔
...

Ahmed El Gabri ahmedelgabri

🤔
...
View GitHub Profile

Read first

I have a local file called ~/.zstuff that I load all ENV variables that is not supposed to be public like $GITHUB_TOKEN in it & I source this file inside my main .zshrc file. The $GITHUB_USER can be added to the same file or your normal .zshrc file since it not a senstive information.

The .zstuff Shoudn't be public or part of your .dotfiles repo.

@ahmedelgabri
ahmedelgabri / mq.styl
Created December 1, 2014 12:26
Media queries in Stylus
MQ = true
mq(point, query1=min, query2=width)
if MQ
query = 'screen and (%s-%s: %sem)' % (query1 query2 point/16)
@media query
{block}
else
{block}
@ahmedelgabri
ahmedelgabri / index.jade
Created December 1, 2014 12:30
Add Custom Jade tags
doctype html
html
head
title Hi
body
div
span= formatDate('Dec 25, 1995')
# From http://sass-guidelin.es/
# For SCSS-Lint v0.31.0
linters:
BangFormat:
enabled: true
space_before_bang: true
space_after_bang: false
@ahmedelgabri
ahmedelgabri / SassMeister-input-HTML.html
Created March 10, 2015 18:47
Generated by SassMeister.com.
<p>Lorem <a href="#">ipsum dolor</a> sit amet</p>
@ahmedelgabri
ahmedelgabri / bbd
Last active September 16, 2015 06:22
A script to list branches by date http://davidwalsh.name/git-branches-date
#!/bin/sh
#
# Usage: bbd "Sep 14"
# bbd "Sep"
git reflog --date=local | grep "$1 .* checkout: moving from .* to" | grep -o "[a-zA-Z0-9\-]*$" | sort | uniq
@ahmedelgabri
ahmedelgabri / cicada.css
Created June 9, 2011 18:24 — forked from Zoramite/cicada.css
Cicada + CSS Backgrounds
.example1 {
background-color: #efefef;
background-image: -webkit-linear-gradient(0, rgba(222,213,108,.07) 50%, transparent 50%), -webkit-linear-gradient(0, rgba(201,184,88,.13) 50%, transparent 50%), -webkit-linear-gradient(0, transparent 50%, rgba(168,137,73,.17) 50%), -webkit-linear-gradient(0, transparent 50%, rgba(99,78,60,.19) 50%);
background-image: -moz-linear-gradient(0, rgba(222,213,108,.07) 50%, transparent 50%), -moz-linear-gradient(0, transparent 50%, rgba(201,184,88,.13) 50%), -moz-linear-gradient(0, rgba(168,137,73,.17) 50%, transparent 50%), -moz-linear-gradient(0, transparent 50%, rgba(99,78,60,.19) 50%);
background-image: -o-linear-gradient(0, rgba(222,213,108,.07) 50%, transparent 50%), -o-linear-gradient(0, transparent 50%, rgba(201,184,88,.13) 50%), -o-linear-gradient(0, transparent 50%, rgba(168,137,73,.17) 50%), -o-linear-gradient(0, rgba(99,78,60,.19) 50%, transparent 50%);
background-image: linear-gradient(0, rgba(222,213,108,.07) 50%, transparent 50%), linear-gradient(0, rgba(201
function getDominantColor(aImg) {
let canvas = document.createElement("canvas");
canvas.height = aImg.height;
canvas.width = aImg.width;
let context = canvas.getContext("2d");
context.drawImage(aImg, 0, 0);
// keep track of how many times a color appears in the image
let colorCount = {};
@ahmedelgabri
ahmedelgabri / search dash app
Created August 3, 2013 14:33
Shell function to search dash app http://kapeli.com/dash from the terminal
# usage: dash <keyword>:<query> or dash <query>
dash(){
open "dash://$@"
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>React for Beginners</title>
</head>
<body>
<div id="App"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.3/react.min.js"></script>