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
if(len(content) < 100): | |
target_file = reject_file | |
else: | |
sample = content.split("\n")[0] | |
if(len(sample) > 15): | |
language = tc.guess_language(sample) | |
else: | |
language = tc.guess_language(content) | |
if('eng' in language): |
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 { MockComponent } from 'ng2-mock-component'; | |
import { By } from '@angular/platform-browser'; | |
describe('ImgGalleryComponent', () => { | |
beforeEach(async(() => { | |
TestBed.configureTestingModule({ | |
declarations: [ | |
ImgGalleryComponent, | |
MockComponent({selector: 'app-img-carousel', inputs: ['images', 'currentSlide', 'isFullscreen']}) | |
] |
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 { By } from '@angular/platform-browser'; | |
import { tick } from '@angular/core/testing'; | |
describe('ExtendedHotelAddressComponent', () => { | |
// ... test setup & other tests | |
it('should display map only after 300ms', fakeAsync(() => { | |
const mapBefore = fixture.debugElement.query(By.css('agm-map')); | |
expect(mapBefore).toBeFalsy(); |
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 AjaxService from 'ember-ajax/services/ajax'; | |
export default AjaxService.extend({ | |
session: Ember.inject.service('session'), | |
host: 'http://localhost:8080', | |
headers: Ember.computed('session', { | |
get() { | |
let headers = {}; |
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
var MongoClient = require('mongodb').MongoClient; | |
exports.connect = function(collection, callback) { | |
MongoClient.connect(process.env.MONGO_CONNECTION_STRING, function(err, db) { | |
if(err !== null) { | |
console.error(err); | |
callback(err); | |
return; | |
} |
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
app.get('/protected', | |
passport.authenticate('bearer', { session: false }), | |
function(req, res) { | |
res.json(req.user); | |
} | |
); |
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
var passport = require('passport'); | |
var BearerStrategy = require('passport-http-bearer').Strategy; | |
var UserStore = require('../stores/user-store'); | |
passport.use(new BearerStrategy( | |
function(token, done) { | |
request('https://www.googleapis.com/oauth2/v3/tokeninfo?access_token=' + token, function(err, response, body) { | |
if(err) { | |
console.error(err); | |
done(err); |
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
#define CAPNP_LITE 1 | |
#include "proto.capnp.h" | |
#include <stdio.h> | |
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <numeric> | |
#include <string> |
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
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: traintracks-es | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: | |
app: traintracks-es |
NewerOlder