Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
...

Ahmed El Gabri ahmedelgabri

🤔
...
View GitHub Profile
@ahmedelgabri
ahmedelgabri / # weechat - 2017-11-21_19-34-28.txt
Created Nov 21, 2017
weechat on macOS 10.13.1 - Homebrew build logs
View # weechat - 2017-11-21_19-34-28.txt
Homebrew build logs for weechat on macOS 10.13.1
Build date: 2017-11-21 19:34:28
@ahmedelgabri
ahmedelgabri / # weechat - 2017-11-21_19-25-39.txt
Created Nov 21, 2017
weechat on macOS 10.13.1 - Homebrew build logs
View # weechat - 2017-11-21_19-25-39.txt
Homebrew build logs for weechat on macOS 10.13.1
Build date: 2017-11-21 19:25:39
@ahmedelgabri
ahmedelgabri / README.md
Last active May 9, 2017
Cron job for automatic renewal of Let’s Encrypt certs, it should run twice a day at a random minute.
View README.md

This is a cron job entry to that will auto renew your Let's Encrypt certificate automatically by running 2 times a day evey 12 hours on a random minute.

You can add a cron job entry by running this command

$ crontab -e

Then past the following snippit in that file, Note that lines 1-3 might not be required at all. Make sure your check the link to the thread regarding this.

@ahmedelgabri
ahmedelgabri / statusline.vim
Last active Jul 23, 2020
Trying to build my vim statusline without plugins
View statusline.vim
" Statusline & Tabline/Buffer line
" Dynamically getting the fg/bg colors from the current colorscheme, returns hex which is enough for me to use in Neovim
" Needs to figure out how to return cterm values too
let fgcolor=synIDattr(synIDtrans(hlID("Normal")), "fg", "gui")
let bgcolor=synIDattr(synIDtrans(hlID("Normal")), "bg", "gui")
" Tabline/Buffer line
set showtabline=2
set tabline="%1T"
View .tern-project
{
"libs": [
"ecma5",
"ecma6",
"browser",
"jquery"
],
"loadEagerly": [],
"async": true,
"dontLoad":[
View .tern-config
{
"ecmaVersion": 6,
"libs": [
"ecma5",
"ecma6",
"browser"
],
"loadEagerly": [],
"async": true,
"plugins": {
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'],
@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();
}
@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)]
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>
You can’t perform that action at this time.