View ruby language
Expressions, Statements and Controlstructures
The ||= idiom
Other assignments
Control-flow keywords
View gist:e8ad83b2604b45f07ce1e8a2eb0a71b0
gpg: Signature made 29 مار, 2016 EET 03:49:47 م using RSA key ID BF04FF17
gpg: can't open `/home/marwan/.gnupg/pubring.gpg'
gpg: keydb_search failed: Permission denied
gpg: Can't check signature: No public key
Warning, RVM 1.26.0 introduces signed releases and automated check of signatures when GPG software found.
Assuming you trust Michal Papis import the mpapis public key (downloading the signatures).
GPG signature verification failed for '/home/marwan/.rvm/archives/rvm-1.27.0.tgz' - ''!
View http.go
func Test(r *http.Request) http.Response {
err := r.Assure("param:numeric")
if err != nil{
return http.Error(400, err)
return http.Success()
View products.go
func Read(r *h.Request) h.Response{
return json(db.GetProducts())
View framework.go
// User Code
type User struct {
Id int
Name string
// implement auth interface
func (u User) Authenticate(r *http.Request) (interface{}, error) {
// auth
return u, nil
View MyEditor.js
var React = require('react');
var Editor = require('draft-js').Editor;
var EditorState = require('draft-js').EditorState;
var MyEditor = React.createClass({
getInitialState: function() {
return {editorState: EditorState.createEmpty()};
onChange: function(editorState) {
View .vimrc
let $GOPATH = 'home/marwan/go'
call plug#begin('~/.vim/plugged')
Plug 'fatih/vim-go'
call plug#end()
View readability.rb
#!/usr/bin/env ruby
# Author : Emad Elsaid (
# **Usage** :
# * `ruby readability.rb <accesstoken>`
# this will get a long term access token from the short term one
# you can create a facebook app and get access token from here
# * `ruby readability.rb`
# will start the script
require 'open-uri'
View gist:8a80863b6d07655880eb
directivesModule.directive('test', function(){
return {
// restrict: 'AEC',
templateUrl: '/public/partials/test.html',
write: function(){
controller: function($scope){