Skip to content

Instantly share code, notes, and snippets.

View amrnt's full-sized avatar

Amr Tamimi amrnt

View GitHub Profile
val text = """Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation pal pal ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute pal irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in Pal culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
#require 'rubygems'
require 'pp'
#require 'ap' # Awesome Print
class Object
# expects [ [ symbol, *args ], ... ]
def recursive_send(*args)
args.inject(self) { |obj, m| obj.send(m.shift, *m) }
end
end
@amrnt
amrnt / enum.rb
Last active December 31, 2015 21:59
Make enum accepts `nil`. Add method `reset_#{enum}!`
module ActiveRecord
# Declare an enum attribute where the values map to integers in the database, but can be queried by name. Example:
#
# class Conversation < ActiveRecord::Base
# enum status: [ :active, :archived ]
# end
#
# # conversation.update! status: 0
# conversation.active!
# conversation.active? # => true

Keybase proof

I hereby claim:

  • I am amrnt on github.
  • I am amrnt (https://keybase.io/amrnt) on keybase.
  • I have a public key ASCtVau4Z9I3c7J1-c677tsXv-WiF32Kdlc1fMYyGZ6d_Qo

To claim this, I am signing this object:

@amrnt
amrnt / client.go
Created June 26, 2014 16:53 — forked from cryptix/client.go
package main
import (
"io"
"log"
"mime/multipart"
"net/http"
"os"
"path/filepath"
"runtime"
@amrnt
amrnt / designer.html
Last active August 29, 2015 14:08
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
* Facebook review Shit
* Mobile Flow
------
- login/signup thru facebook
- Map/List of locations around you
- Location -> Info + Offers
- If he has the QR code of the branch, and in the range of 10m of that location, checkin.
- After; If you share on facebook, points++.
- Callback the api after share succeeded.
- Claim reward: Share; points++
@amrnt
amrnt / main.go
Last active August 29, 2015 14:15
package main
import (
"github.com/robertkrimen/otto"
)
func main() {
vm := otto.New()
vm.Run(`
function fib(n) {
@amrnt
amrnt / main.go
Last active August 29, 2015 14:24 — forked from anonymous/main.go
package main
import (
"net/http"
"strconv"
"github.com/labstack/echo"
mw "github.com/labstack/echo/middleware"
"github.com/rs/cors"
"github.com/thoas/stats"
^ Wed 16/12
v Thu 17/12
v Fri 18/12
- Sat 19/12
- Sun 20/12
Mon 21/12
Tus 22/12
Wed 23/12
* Thu 24/12
* Fri 25/12