Skip to content

Instantly share code, notes, and snippets.

View ahmed1490's full-sized avatar

Ahmed Abbas ahmed1490

View GitHub Profile
@wojtha
wojtha / fake_stripe_server.rb
Last active September 28, 2016 22:06
Fake Stripe mock backend server for generating tokens for stripe.js
#!/usr/bin/env ruby
require 'sinatra/base'
require 'json'
require 'stripe_mock'
# Mount fake Sinatra Stripe Server to Capybara
#
# Example:
#
# feature 'Subscribe' do
@kristianmandrup
kristianmandrup / Converting libraries to Ember CLI addons.md
Last active March 12, 2025 04:26
Guide to Developing Addons and Blueprints for Ember CLI

Converting libraries to Ember CLI addons

In this guide we will cover two main cases:

  • Ember specific library
  • vendor library

Ember library

The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.

@alexparker
alexparker / *bigcartel.slack.com*
Created September 11, 2014 18:14
UserScript for toggling slack sidebar
var sideBar = $('#col_channels_bg').is(':visible');
$(window).on('keypress', function(e) {
// uses cmd+b
if (e.metaKey && e.charCode == 98) {
var display = sideBar ? 'none' : 'initial';
var left = sideBar ? 0 : '';
$('#col_channels_bg, #col_channels').css('display', display);
$('#messages_container').css('margin-left', left);
$('#footer').css('left', left);
@gaearon
gaearon / ClassNameMixin.js
Last active March 23, 2018 17:18
BEM in React
'use strict';
var React = require('react'),
classSet = require('react/lib/cx'),
_ = require('underscore');
var ClassNameMixin = {
propTypes: {
className: React.PropTypes.string,
context: React.PropTypes.string
@mlynch
mlynch / auth.markdown
Last active September 4, 2020 18:11
AngularJS Authentication and CORS

Single Page Apps are ruling the world and AngularJS is leading the charge. But many of the lessons we learned in the Web 2.0 era no longer apply, and few are as drastically different as authentication.

CORS

CORS is an oft-misunderstood feature of new browsers that is configured by a remote server. CORS stands for Cross-Origin-Resource-Sharing, and was designed to make it possible to access services outside of the current origin (or domain) of the current page.

Like many browser features, CORS works because we all agree that it works. So all major browsers like Chrome, Firefox, and IE support and enforce it. By using these browsers, you benefit from the security of CORS.

That means certain browsers do not enforce it, so it is not relevant there. One large example is a native Web View for things like Cordova and Phonegap. However, these tools often have configuration options for whitelisting domains so you can add some security that way.

@jakecraige
jakecraige / checkedItems.js
Created July 17, 2014 00:15
ember checkboxes
checkedItems: Ember.computed.mapBy(‘proxiedCheckedItems’, ‘content’);
@staltz
staltz / introrx.md
Last active April 19, 2025 05:15
The introduction to Reactive Programming you've been missing
@MohamedAlaa
MohamedAlaa / sublime-settings.md
Last active August 28, 2024 14:02
Standard Sublime Settings Proposal

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

@adamburvill
adamburvill / basicOsx
Last active August 29, 2015 13:56 — forked from saetia/gist:1623487
Basic Mac OSX Setup
[Mensch font](http://robey.lag.net/2010/06/21/mensch-font.html),
[Source Code Pro](http://sourceforge.net/projects/sourcecodepro.adobe/files/),
[Webkit](http://webkit.org),
[Chrome](http://google.com/chrome),
[Firefox](http://firefox.com),
[Kaleidoscope](http://www.kaleidoscopeapp.com),
[iTerm](http://iterm2.com),
[Sublime Text](http://www.sublimetext.com/dev),
[Sequel Pro](http://nightly.sequelpro.com),
[Codekit](http://incident57.com/codekit/),