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
| (function(){ | |
| //saving the original console.log function | |
| var preservedConsoleLog = console.log; | |
| //overriding console.log function | |
| console.log = function() { | |
| //we can't just call to `preservedConsoleLog` function, | |
| //that will throw an error (TypeError: Illegal invocation) | |
| //because we need the function to be inside the |
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
| (function ($) { | |
| var compiled = {}; | |
| $.fn.handlebars = function (template, data) { | |
| if (template instanceof jQuery) { | |
| template = $("<div />").append($(template).clone()).html(); | |
| } | |
| compiled[template] = Handlebars.compile(template); | |
| this.html(compiled[template](data)); | |
| }; | |
| })(jQuery); |
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 React, {Component} from 'react' | |
| import {View, Text} from 'react-native' | |
| import {mobxify} from 'utils' | |
| class App extends Component { | |
| render() { | |
| return ( | |
| <View> | |
| <Text>mobxify is awesome!</Text> | |
| </View> |
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 https = require('https'); | |
| exports.get = function(accessToken, apiPath, callback) { | |
| // creating options object for the https request | |
| var options = { | |
| // the facebook open graph domain | |
| host: 'graph.facebook.com', | |
| // secured port, for https | |
| port: 443, |
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
| const ADHDHelpers = (function () { | |
| let module = { | |
| scrollTop: 0, | |
| isDisabled: false, | |
| shouldDisplayScrollbar: false, |
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
| { | |
| "TypeScript": 57718, | |
| "JavaScript": 11731, | |
| "CSS": 2708, | |
| "HTML": 899 | |
| } |
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
| <svg width="100px" height="120px" viewBox="0 0 100 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | |
| <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> | |
| <g transform="translate(0.000000, -10.000000)"> | |
| <circle fill="#FFDA76" cx="51" cy="51" r="32"></circle> | |
| <g transform="translate(45.000000, 27.000000)" fill="#000000"> | |
| <path d="M6,0 L6,0 C7.65685425,-3.04359188e-16 9,1.34314575 9,3 L9,21 C9,22.6568542 7.65685425,24 6,24 L6,24 C4.34314575,24 3,22.6568542 3,21 L3,3 C3,1.34314575 4.34314575,3.04359188e-16 6,0 Z"></path> | |
| <circle cx="6" cy="24" r="6"></circle> | |
| </g> | |
| <path d="M51,87 C70.882251,87 87,70.882251 87,51 C87,31.117749 70.882251,15 51,15 C31.117749,15 15,31.117749 15,51" stroke="#000000" stroke-width="5" stroke-linecap="round" stroke-linejoin="round" transform="translate(51.000000, 51.000000) rotate(-45.000000) translate(-51.000000, -51.000000) "></path> |
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 { RouteModel, validationParam, validator } from "appolo"; | |
| import { enumValues } from "../../common/utils"; | |
| import { GaugeType, OutputFormat } from "../../common/enums"; | |
| import { TEN_MINUTES_IN_SECONDS } from "../../common/constants"; | |
| export class LangaugeModel extends RouteModel { | |
| // Git repository owner | |
| @validationParam(validator.string().required()) | |
| owner: string; |
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 { controller, Controller, inject, get, IRequest, IResponse, validation } from "appolo"; | |
| import { LangaugeModel } from "./langaugeModel"; | |
| import { LangaugeManager } from "../../managers/langaugeManager"; | |
| import { OutputFormatContentType } from "../../common/enums"; | |
| import { promisify } from "util"; | |
| import * as zlib from "zlib"; | |
| const gzip = promisify<Buffer, Buffer>(zlib.gzip); | |
| @controller() |
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
| @cache({ maxAge: TEN_MINUTES_IN_MILLISECONDS, multi: true }) | |
| public async generate(owner: string, repo: string, options: ILangaugeOptions): Promise<Buffer> { | |
| try { | |
| const createRenderer = this.rendererCreators[options.type]; | |
| let languages = await this.githubService.getRepositoryLanguages(owner, repo); | |
| if (options.threshold) { | |
| languages = this.thresholdLanguagesFilter(languages, options.threshold); |
OlderNewer