Skip to content

Instantly share code, notes, and snippets.

@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; */
}
# 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
@ahmadseleem
ahmadseleem / Viewport_Resizer_bookmarklet
Created November 1, 2014 02:41
VIEWPORT RESIZER - RESPONSIVE DESIGN BOOKMARKLET - Customized ( iphone 6 & 6 plus added )
javascript:void((function(d){if(self!=top||d.getElementById('toolbar')&&d.getElementById('toolbar').getAttribute('data-resizer'))return%20false;d.write('<!DOCTYPE%20HTML><html%20style="opacity:0;"><head><meta%20charset="utf-8"></head><body><a%20data-viewport="320x480"%20data-icon="mobile"%20title="Mobile%20(e.g.%20Apple%20iPhone)">Mobile%20(e.g.%20Apple%20iPhone)</a><a%20data-viewport="320x568"%20data-icon="mobile"%20data-version="5"%20title="Apple%20iPhone%205">Apple%20iPhone%205</a><a%20data-viewport="375x667"%20data-icon="mobile"%20data-version="6"%20title="Apple%20iPhone%206">Apple%20iPhone%206</a><a%20data-viewport="414x736"%20data-icon="mobile"%20data-version="6p"%20title="Apple%20iPhone%206p">Apple%20iPhone%206p</a><a%20data-viewport="600x800"%20data-icon="small-tablet"%20title="Small%20Tablet">Small%20Tablet</a><a%20data-viewport="768x1024"%20data-icon="tablet"%20title="Tablet%20(e.g.%20Apple%20iPad%202-3rd,%20mini)">Tablet%20(e.g.%20Apple%20iPad%202-3rd,%20mini)</a><a%20data-viewport="1280x800"%20dat
#!/bin/zsh
# Download YouTube video:
cd ~/Downloads/
for file in "$@"
do
name=$(echo "$file" | cut -d '&' -f 1)
youtube-dl -o "%(title)s.%(ext)s" "$name"
done
extension Int {
func times(task: () -> () ) {
for i in 0..<self {
task()
}
}
}
10.times { println("Hello!") }
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
;; ................................................................
(add-to-list 'load-path "~/.emacs.d/evil")
(require 'evil)
(evil-mode 1)
(setq evil-shift-width 2)
@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">
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;
}
},