Skip to content

Instantly share code, notes, and snippets.

Avatar

Amr Eldib AmrEldib

View GitHub Profile
@AmrEldib
AmrEldib / git.lua
Created Feb 29, 2016
Customize Windows Cmder Prompt
View git.lua
---
-- Find out current branch
-- @return {false|git branch name}
---
function get_git_branch()
for line in io.popen("git branch 2>nul"):lines() do
local m = line:match("%* (.+)$")
if m then
return m
end
@AmrEldib
AmrEldib / 404ForCaseSensitiveURLs.js
Created Feb 7, 2016
Jekyll 404 page on GitHub Pages to fix case sensitive URLs
View 404ForCaseSensitiveURLs.js
var allposts = [];
function redirectToCorrectPage() {
{% for post in site.posts %}
allposts.push("{{ site.url }}{{ post.url }}");
{% endfor %}
var url = window.location.toString();
if (url.slice(-1) === "/") {
url = url.slice(0, -1);
}
var allpostsUpperCase = allposts.map(function(value) {
@AmrEldib
AmrEldib / npm-g.md
Last active Feb 19, 2016
Recommended Global npm Packages to install
View npm-g.md

bower
ember-cli
ember-cli-windows
gitignore
jshint
swagger
editorconfig-cli

@AmrEldib
AmrEldib / userstyle.css
Created Jan 2, 2016
Updated UserStyle for Better Arabic Font on Twitter
View userstyle.css
/*
This is a modified version of the userstyle "Twitter Persian/Arabic Optimization"
https://userstyles.org/styles/119923/twitter-persian-arabic-optimization
This modification applies the Arabic font only on text with Arabic language while keeping
other languages with the default font
This is done using the :lang(ar) attribute
http://stackoverflow.com/a/15267560/463
*/
@AmrEldib
AmrEldib / ChocolateyInstalls.txt
Last active Aug 29, 2015
Chocolatey Installs
View ChocolateyInstalls.txt
choco install 7zip.install
choco install cmdermini
choco install flashplayerplugin
choco install flashplayeractivex
choco install notepadplusplus.install
choco install sumatrapdf.install
choco install libreoffice
choco install ccleaner
choco install vlc
choco install clover
View KeybaseProof.txt
### Keybase proof
I hereby claim:
* I am AmrEldib on github.
* I am amr (https://keybase.io/amr) on keybase.
* I have a public key whose fingerprint is D629 1605 2F4E 3B96 A510 276E C9DE FAD6 D0F4 A3C9
To claim this, I am signing this object:
View AppLogger-GetTempFileName.cs
string logFilePath = Path.GetTempFileName();
View AppLogger-Configure.cs
XmlConfigurator.Configure(stream);
View AppLogger-ILog.cs
#if DEBUG
ILog log = LogManager.GetLogger("Logger");
log.Debug("Message");
#endif
View AppLogger-Using.cs
#if DEBUG
using log4net;
using log4net.Config;
#endif
You can’t perform that action at this time.