This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Assignment < ActiveRecord::Base | |
| # $LOUD_N_CLEAR = true | |
| # Counts workdays between two Dates (not Time) | |
| def count_weekdays(startdate,stopdate) | |
| @workdays = 0 | |
| startdate.to_date.upto(stopdate.to_date) do |date| | |
| if date.wday.to_s =~ /[0,1,2,3,4]/ | |
| @workdays +=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it "can invite others" do | |
| login(@user, @password) | |
| visit group_path(@group) | |
| within '#group_header' do |scope| | |
| scope.click_link 'Invite' | |
| end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mysqldump -u USER -p PASSWORD database | gzip -9 > BACKUP/prod-`date +%Y.%m.%d`c.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Martins-iMac-4429% rvm --trace use 1.9.2-p290 | |
| +__rvm_parse_args:637> [[ -n 4.3.11 ]] | |
| +__rvm_parse_args:672> [[ -z '' && -n '' ]] | |
| +__rvm_parse_args:675> [[ error == || 0 -eq 1 || -n '' ]] | |
| +__rvm_parse_args:16> [[ -n use ]] | |
| +__rvm_parse_args:18> rvm_token=use | |
| +__rvm_parse_args:20> (( 1 > 0 )) | |
| +__rvm_parse_args:22> next_token=1.9.2-p290 | |
| +__rvm_parse_args:23> shift | |
| +__rvm_parse_args:28> case use ([[:alnum:]]*|@*) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class GeoData | |
| require 'json' | |
| require 'net/http' | |
| attr_reader :lat, :lon | |
| def initialize(lat: lat, lon: lon) | |
| @lat = lat | |
| @lon = lon | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app = angular.module("trenger") | |
| app.controller 'SessionCtrl', ['$scope', '$http', '$window', '$localStorage', '$q', | |
| ($scope, $http, $window, $localStorage, $q) -> | |
| $scope.current_user = JSON.parse($("meta[name='current_user']").attr('content')) | |
| $scope.authErrors = [] | |
| defer = $q.defer() | |
| $scope.authorized = () -> | |
| $scope.current_user? and $scope.current_user._id? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app = angular.module("trenger") | |
| app.controller 'SessionCtrl', ['$scope', '$http', '$window', '$localStorage', '$q', | |
| ($scope, $http, $window, $localStorage, $q) -> | |
| $scope.current_user = JSON.parse($("meta[name='current_user']").attr('content')) | |
| $scope.authErrors = [] | |
| defer = $q.defer() | |
| $scope.token = $localStorage.token |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TemplatesController < ApplicationController | |
| skip_before_filter :authenticate_user! | |
| #skip_authorization_check :template | |
| def template | |
| render :template => 'templates/' + params[:path], :layout => false | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module('app', []) | |
| .directive('starred', function() { | |
| return { | |
| restrict: 'E', | |
| scope: { | |
| objectClass: '=' | |
| }, | |
| templateUrl: '/templates/starred.html.slim', | |
| controller: function($scope, $attrs) { | |
| return $scope.star_clicked = function(e) { |
OlderNewer