Skip to content

Instantly share code, notes, and snippets.

Mohamed A. Hassan MohamedAlaa

Block or report user

Report or block MohamedAlaa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@MohamedAlaa
MohamedAlaa / problem_2.rb
Last active Aug 29, 2015
Egyptian Geeks - Project Euler Problem 2
View problem_2.rb
#! /usr/bin/env ruby
first = 0
second = 1
i = 0
sum = 0
limit = 4000000
while i <= limit
i = first + second
View irc-bot.rb
#!/usr/bin/env ruby
require 'cinch' # gem install cinch --no-ri --no-rdoc
require 'askwiki' # gem install askwiki --no-ri --no-rdoc
bot = Cinch::Bot.new do
configure do |c|
c.server = "irc.freenode.org"
c.nick = "Ask_wikipedia"
c.channels = ["#cinch-bots"]
View jquery.css3caching.js
(function($) {
function parseImagesFromCSS(doc) {
var i, j,
rule,
image,
pattern = /url\((.*)\)/,
properties = ['background-image', '-webkit-border-image'],
images = {};
if (doc.styleSheets) {
@MohamedAlaa
MohamedAlaa / nvd3.scss
Last active Aug 29, 2015
nvd3 Scatter hide the lines in the x and y Axis
View nvd3.scss
.nv-scatterChart {
.nv-distributionX line.nv-distx[y1="0"],
.nv-distributionY line.nv-disty[x2="8"]
{
display: none;
}
}
@MohamedAlaa
MohamedAlaa / Breezi-cPanel-News-Update.html
Created Oct 25, 2012 — forked from anonymous/Breezi cPanel News Update
Breezi cPanel Plugin News Announcement
View Breezi-cPanel-News-Update.html
<strong>NEW: Breezi Website Builder!</strong></br></br>Click <i>Breezi Website Builder</i> under <i>Software/Services</i> to try the most flexible yet easy-to-use site builder, with automatic mobile website optimization – <u>FREE!</u></br></br>
<img title="Scroll down & click Breezi Website Builder" src="http://breezi.com/wp-content/uploads/2012/10/plugin-cta-graphic.png"/>
@MohamedAlaa
MohamedAlaa / 0_reuse_code.js
Created Nov 16, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View markets.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View jquery-attached-events
// This is a simple function to get all the attached jquery events on all the DOM elements
// you will find a new data attribute on the elements that has events attached to it.
(function() {
if (window.jQuery) {
var elms = [],
elm = {},
attrs = "",
evTypes = 0,
evCounter = 0,
elmCounter = 0,
@MohamedAlaa
MohamedAlaa / sublime-settings.md
Last active Jun 21, 2017
Standard Sublime Settings Proposal
View sublime-settings.md

Problem we are trying to resolve

One of the Problems we face in any teams is that every one has his own sublime settings for spacing indentation which cause a problem when you push to git hub as some prefer using tabs for indentation and others using spacing.

Wrong Spacing and indentation example

The Objective

The objective is to standardize your sublime settings for readability and to avoid extra indentation or spaces after each line you write

@MohamedAlaa
MohamedAlaa / index.html
Last active Jul 3, 2017 — forked from enjalot/index.html
Show value in Pie Chart example with D3.js
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Testing Pie Chart</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.1.3"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?2.1.3"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.1.3"></script>
<style type="text/css">
You can’t perform that action at this time.