View build_routes.js
This file contains 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
export function parseName(path) { | |
const name = path.toLowerCase() | |
// Remove starting ./ | |
.replace(/^\.\//, '') | |
// Parameters | |
.replace(/\/_(\w+)(\/|\.vue$)/, '/:$1/') | |
// Remove file extension and 'index' | |
.replace(/(index)?\.vue$/, '') | |
// Remove trailing '/' | |
.replace(/\/$/, ''); |
View type_compatibility.ts
This file contains 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 TypeOne { | |
public one | |
private two | |
private three | |
} | |
class TypeTwo { | |
public one | |
} |
View angular.d.ts
This file contains 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
// Type definitions for Angular JS 1.5 | |
// Project: http://angularjs.org | |
// Definitions by: Diego Vilar <http://github.com/diegovilar> | |
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | |
/// <reference types="jquery" /> | |
declare var angular: angular.IAngularStatic; | |
// Support for painless dependency injection |
View useful_object.rb
This file contains 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
# Provides a default implementation of the singleton methods of buildable and | |
# callable classes based on the Useful Object's concept. | |
# | |
module UsefulObject | |
def self.included(base) | |
base.extend(Builder) | |
end | |
module Builder | |
def build(*args, **kargs, &block) |
View test_helper.rb
This file contains 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 ActionDispatch::IntegrationTest | |
# Override Rails open_session so we can use an instance involved block | |
# instead of passing the session instance and using it. This allows the block | |
# to work exactly the same as the regular test. | |
def open_session(&block) | |
return super if block.nil? || block.arity > 0 | |
super do |session| | |
session.instance_eval(&block) | |
end | |
end |
View sorted_test_order.rb
This file contains 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
# So far I have tried the following code in test_helper.rb | |
# Based on documentation here: http://api.rubyonrails.org/v4.2/classes/ActiveSupport/TestCase.html | |
class ActiveSupport::TestCase | |
def test_order | |
:sorted | |
end | |
end |
View rails_auto_reloader.rb
This file contains 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 'auto_reloader' | |
module RailsAutoReloader | |
def self.activate | |
AutoReloader.activate reloadable_paths: ['lib'] | |
end | |
class Middleware | |
def initialize(app) | |
@app = app |
View downgradedAngular2Component.ts
This file contains 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 {Component, Inject, AfterViewInit} from 'angular2/core'; | |
import {upgradeAdapter} from 'upgrade_adapter'; | |
const template = require('./template.html'); | |
// Step 1: Upgrade any Angular 1.x components we depend on | |
const Dialog = upgradeAdapter.upgradeNg1Component('Dialog'); | |
// Step 2: Import any Angular 2.x components we depend on | |
import {Calendar} from '../calendar'; |
View jwt_session_store.rb
This file contains 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 'active_support/key_generator' | |
module ActionDispatch | |
module Session | |
class JWTStore < AbstractStore | |
GENERATOR_KEY = "action_dispatch.key_generator".freeze | |
JWT_SECRET_SALT = "jwt secret salt".freeze | |
def initialize | |
super |
View angular.html.slim
This file contains 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
| <script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true; | |
s.src='https://widget.intercom.io/widget/#{ENV['INTERCOM_APP_ID']}'; | |
var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script> |
NewerOlder