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
| require 'sprockets' | |
| require 'pry' | |
| require 'fileutils' | |
| namespace :karma do | |
| task :start => :environment do | |
| with_tmp_config :start | |
| end | |
| task :run => :environment do |
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
| namespace :assets do | |
| desc "fetch descriptions for youtube videos without descriptions" | |
| task yt_fetch_description: :environment do | |
| BsuDescriptionUpdater.new(YtChanReg, FbPgeReg, IgUsrReg).update_all | |
| end | |
| end | |
| class BsuDescriptionUpdater | |
| def initialize(*source_klasses) | |
| @source_klasses = source_klasses.map { |src| DescriptionUpdater.new(src) } |
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
| var API = function () { | |
| }; | |
| API.prototype.login = function(username, password) { | |
| console.log("request username and pw to server..."); | |
| this.auth_token = "nhonhonho"; | |
| }; | |
| API.prototype.getUserById = function(user_id) { | |
| if (this.auth_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
| var xhr_request = function (post_url, xsrf_token, ids, start_interval, end_interval, callback){ | |
| var request = { page_ids: ids, start: start_interval, end: end_interval}; | |
| var oReq = new XMLHttpRequest(); | |
| oReq.addEventListener("load", callback); | |
| oReq.open("POST", post_url); | |
| oReq.setRequestHeader("Content-Type", "application/json"); | |
| oReq.setRequestHeader("X-CSRF-Token", xsrf_token); | |
| oReq.send(JSON.stringify(request)); | |
| }; |
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
| // ==UserScript== | |
| // @name Verify fitness hut class availability | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description try to take over the world! | |
| // @author You | |
| // @match https://www.myhut.pt/myhut/aulas/* | |
| // @grant none | |
| // @require http://code.jquery.com/jquery-latest.js | |
| // ==/UserScript== |
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
| import { AfterViewInit, Directive, ElementRef, Input, OnDestroy } from '@angular/core'; | |
| import { ActivatedRoute, Router } from '@angular/router'; | |
| import { Subscription } from 'rxjs/Subscription'; | |
| @Directive({ | |
| selector: '[flScrollBulletinIntoView]' | |
| }) | |
| export class ScrollBulletinIntoViewDirective implements AfterViewInit, OnDestroy { | |
| @Input() bulletinId: number; | |
| private scrollIntoView$: Subscription; |
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
| import { AfterViewInit, Directive, ElementRef, HostListener, Input } from '@angular/core'; | |
| import { UserService } from '../shared/services/user.service'; | |
| @Directive({ | |
| selector: '[flEditable]' | |
| }) | |
| export class EditableDirective implements AfterViewInit { | |
| @Input('endpoint') endpoint; |
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
| // ==UserScript== | |
| // @name Verify fitness hut class availability | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description try to take over the world! | |
| // @author You | |
| // @match https://www.myhut.pt/myhut/aulas/* | |
| // @grant none | |
| // @require https://cdnjs.cloudflare.com/ajax/libs/rxjs/5.4.3/Rx.js | |
| // ==/UserScript== |
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
| var ids = []; | |
| if ($scope.attendeesToggle) { ids = ids.concat($scope.eventAttendees); } | |
| if ($scope.waitingListToggle) { ids = ids.concat($scope.eventWaitingList); } | |
| //-------- | |
| [ | |
| { condition: () => $scope.attendeesToggle, array: $scope.eventAttendees }, | |
| { condition: () => $scope.waitingListToggle, array: $scope.eventWaitingList } |