Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
...

Ahmed El Gabri ahmedelgabri

🤔
...
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am ahmedelgabri on github.
  • I am ahmedelgabri (https://keybase.io/ahmedelgabri) on keybase.
  • I have a public key ASBn5CQMC-lRe3exGPiMon9fXrgYYbBm3ycEoHccpL1alQo

To claim this, I am signing this object:

@ahmedelgabri
ahmedelgabri / _README.md
Last active Feb 17, 2017
Node script to export all your delicious bookmarks
View _README.md
  1. Download or clone the gist.
  2. cd into the directory & do $ npm install
  3. I have used nodedelicious and it needs you to store delcious username & password as enviromnet varaibles so you will need to do the following.
$ export DELICIOUS_USER="<your username>" && export DELICIOUS_PASSWORD="<your password>"
  1. Run $ node index.js
  2. PROFIT! you have your delicious export in a file called bookmarks.html that you can save or import in Pocket.
View .scss-lint.yaml
# 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 Mar 10, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<p>Lorem <a href="#">ipsum dolor</a> sit amet</p>
View bbd
#!/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
View foo.html
<!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>
@ahmedelgabri
ahmedelgabri / helpers.js
Last active Dec 28, 2015
JS helper functions
View helpers.js
// $('div') or $('.class', $('div'))
const $ = (selector, parent) => (parent || document).querySelector(selector)
// $$('div') or $$('.class', $('div')) => returns a real Array not a NodeList
const $$ = (selector, parent) => [...(parent || document).querySelectorAll(selector)]
@ahmedelgabri
ahmedelgabri / getType.js
Created Jan 8, 2016
Simple check for the type of an object
View getType.js
function getType(target){
return Object.prototype.toString.call(target).slice(8, -1).toLowerCase();
}
View flow-vim-quickfix.vim
if findfile('.flowconfig', '.;') !=# ''
if executable($PWD .'/node_modules/.bin/flow')
let g:flow_path = $PWD .'/node_modules/.bin/flow'
else
let g:flow_path = 'flow'
endif
let g:neomake_javascript_flow_maker = {
\ 'exe': 'sh',
\ 'args': ['-c', g:flow_path.' --json --strip-root | flow-vim-quickfix'],
View .tern-config
{
"ecmaVersion": 6,
"libs": [
"ecma5",
"ecma6",
"browser"
],
"loadEagerly": [],
"async": true,
"plugins": {