Skip to content

Instantly share code, notes, and snippets.

View neumachen's full-sized avatar
🏠
Working from home

Kareem H neumachen

🏠
Working from home
  • Bergen, Norway
  • 14:20 (UTC -12:00)
View GitHub Profile
@michael-harrison
michael-harrison / angular_road.md
Last active August 29, 2015 14:05
Rails & the Angular road: Beginnings

This article expects that you already have done the 101 AngularJS journey. If you're new to AngularJS then you'd best checkout the AngularJS Tutorial or Code Academy - AngularJS Patterns Tutorial(NB: this is for Angular 1.0.6) before continuing with this article. What we're really focusing on here are the decisions I've made and nuances discovered during the transition of a Rails app with the least resistance using the following stack:

  • Rails 4.0.x
  • Haml
  • Sass
  • Coffee
  • Devise with CanCan
  • jQuery
  • Twitter Bootstrap
  • PostgeSQL
@aaronjensen
aaronjensen / teamcity.rake
Created April 28, 2011 06:53
our teamcity rake.
task :teamcity => ['teamcity:clean', 'teamcity:setup', 'barista:brew', 'fork:spec', 'teamcity:cucumber', 'jasmine:ci']
namespace :teamcity do
task :setup do
RAILS_ENV = 'test'
Rake::Task['db:drop'].invoke
Rake::Task['db:create'].invoke
Rake::Task['db:schema:load'].invoke
end
@xcooper
xcooper / grid-submit-json.js
Created August 12, 2013 09:55
overwrite jqGrid ajax mechanism, send json to backend instead of submitting a form. datatype should be "json" "xml" "script" postData is data you wanna send ajaxGridOptions is ajax configuration of jQuery serializeGridData is a function having only one argument which is postData you provided, it should return a Serialized data(e.g. String)
self.grid.jqGrid("setGridParam", {
serializeGridData: self.serializeData,
url: self.executionUrl,
datatype: "json",
ajaxGridOptions: {
cache: false,
contentType: "application/json",
processData: false,
type: "POST"
},
@jcap49
jcap49 / gist:7111076
Last active December 26, 2015 06:49
class CustomUsersController < Devise::RegistrationsController
def new
super
end
def create
build_resource(sign_up_params)
if resource.save
set_text_message
@7-fl
7-fl / makefile
Last active March 17, 2017 17:26
Simple erlang makefile
#------------!WARNING!------------------
#makefiles require an actual tab character for the indenting.
#I use macvim as my text editor, and I have it configured
#to convert tabs to spaces for all file types. To make sure
#that doesn't happen to a makefile, I added the following to
# ~/.vimrc:
#
# au FileType make setlocal noexpandtab tabstop=4 shiftwidth=4 softtabstop=0
#
#---------------------------------------
@dmoco
dmoco / index.erl
Last active March 17, 2017 17:27
-module(index).
-export([index_file/1,show_index/1,get_file_contents/1,show_file_contents/1]).
-include_lib("eunit/include/eunit.hrl").
%%% ASSIGNMENT 2.20 - INDEXING WORDS IN LINES FROM A TEXT FILE
% Example files available in:
% gettysburg-address.txt (short)
% dickens-christmas.txt (long)
-module(rps).
-export([result/2, tournament/2, test/0]).
-include_lib("eunit/include/eunit.hrl").
beat(rock) -> paper;
beat(paper) -> scissors;
beat(scissors) -> rock.
%% lose(rock) -> scissors;
%% lose(paper) -> rock;
@paucus
paucus / rps.erl
Last active March 20, 2017 19:30
%%% assignment 3.12 Functional Programming in Erlang, 2017
-module(rps).
-export([play/1,echo/1,play_two/3,rock/1,no_repeat/1,const/1,enum/1,cycle/1,rand/1,val/1,tournament/2]).
-export([type_count/1, least_freq_played/1,most_freq_played/1,rand_strategy/1]).
-created_by("Marcelo Ruiz Camauër").
-include_lib("eunit/include/eunit.hrl").
@learncodeacademy
learncodeacademy / .drone.yml
Created June 28, 2017 16:28
Rancher Drone CD Pipeline Setup
pipeline:
slack:
image: plugins/slack
webhook: <your slack webhook url>
channel: deployments
username: drone
template: "<{{build.link}}|Deployment #{{build.number}} started> on <http://github.com/{{repo.owner}}/{{repo.name}}/tree/{{build.branch}}|{{repo.name}}:{{build.branch}}> by {{build.author}}"
when:
branch: [ master, staging ]
build:
@leesei
leesei / uri_parser.sh
Last active February 1, 2018 16:16
#bash #uri_parser bash uri parser
#!/bin/bash
#
# URI parsing function
#
# The function creates global variables with the parsed results.
# It returns 0 if parsing was successful or non-zero otherwise.
#
# [schema://][user[:password]@]host[:port][/path][?[arg1=val1]...][#fragment]
#