Skip to content

Instantly share code, notes, and snippets.

var eventUtility = {
addEvent : function(el, type, fn) {
if (typeof addEventListener !== "undefined") {
el.addEventListener(type, fn, false);
} else if (typeof attachEvent !== "undefined") {
el.attachEvent("on" + type, fn);
} else {
el["on" + type] = fn;
}
},
@ahmadseleem
ahmadseleem / styles.css
Created May 26, 2018 22:19
vscode custom css
.vs.monaco-editor .ced-TextEditorDecorationType12-4::after {
color: mediumaquamarine !important;
/* background-color: mediumaquamarine; */
/* text-shadow: 8px -1px 0px black; */
/* box-shadow: inset 0 0 1px black; */
}
@ahmadseleem
ahmadseleem / after.vimrc
Last active December 27, 2015 17:29
after.vimrc
" ================ General Config ====================
set nuw=3
let g:Powerline_symbols = 'compatible'
set number "Line numbers are good
set backspace=indent,eol,start "Allow backspace in insert mode
set history=1000 "Store lots of :cmdline history
set showcmd "Show incomplete cmds down the bottom
set showmode "Show current mode down the bottom
set gcr=a:blinkon0 "disable cursor blink
@ahmadseleem
ahmadseleem / index.html
Created March 29, 2013 04:11
A CodePen by Anonymous. Simple, CSS only, responsive menu - Enjoy!
<head>
<meta name="viewport" content="width=device-width">
</head>
<div class="wrap">
<span class="decor"></span>
<nav>
<ul class="primary">
<li>
<a href="">Dog</a>
<ul class="sub">
@ahmadseleem
ahmadseleem / index.html
Created November 21, 2012 22:53
A CodePen by ahmadseleem. Share It - reloaded - Improvement of my previous pen "Share it" - POC of a share button full css and font Inspired by http://dribbble.com/shots/712083-Share-widget?list=popular&offset=7
<h1>Hover they</h1>
<div class="container">
<div class="cell ">
<div class="share-wrapper left">
<div class="rc10 share-action icon-share"></div>
<div class="share-container rc10">
<a class="share-btn tl icon-google-plus" href='#'></a>
@ahmadseleem
ahmadseleem / .vimrc
Created November 15, 2012 08:07
vim config
" ================ General Config ====================
set number "Line numbers are good
set backspace=indent,eol,start "Allow backspace in insert mode
set history=1000 "Store lots of :cmdline history
set showcmd "Show incomplete cmds down the bottom
set showmode "Show current mode down the bottom
set gcr=a:blinkon0 "disable cursor blink
set visualbell "no sounds
set autoread "reload files changed outside vim
@ahmadseleem
ahmadseleem / disable_google_black_bar.js
Last active October 12, 2015 19:38
Disable Google Black Bar
// ==UserScript==
// @name Disable Google Black Bar
// @description Hides the ugly Black Bar from Google Search. - ahmadseleem.com -
// @include *.google.*/*
// @exclude *plus.google.*
// ==/UserScript==
(function () {
var css = "#gbx3 {display:none; visibility:hidden; !important;}\n";
css += "#gbzw {display:none; visibility:hidden; !important;}\n";
css += "#gbx1 {top:0 !important;}\n";
@ahmadseleem
ahmadseleem / rbenv-for-zshrc
Created July 10, 2012 15:33
rbenv for zshrc
# -------------------------------------------------------------------------------------
export PATH=$PATH:$HOME/.rbenv/bin
export PATH=$PATH:$HOME/.rbenv/shims
# RVM / rbenv
if [[ -d ~/.rvm/ ]] && [[ -d ~/.rbenv/ ]]; then
# TODO: colorize
echo '***************************************************************'
echo 'ERROR!'
echo 'YADR found both ~/.rvm and ~/.rbenv directories. You cannot use'
# Convert Decimals to Roman numerals...
#
module Roman
ROMAN_STEPS =
{
'M' => 1000, 'CM' => 900,
'D' => 500, 'CD' => 400,
'C' => 100, 'XC' => 90,
'L' => 50, 'XL' => 40,
'X' => 10, 'IX' => 9,
#
# Check if an Array could be sorted by One-Swap.
#
# Extend Array Class...
class Array
def sorted?
# each_cons(2).all? { |a, b| (a <=> b) <= 0 }
self == self.sort
end