http://www.gamesjobsjapan.com/
- Grasshopper
http://www.gamesjobsjapan.com/
/** | |
* Annoying.js - How to be an asshole to your users | |
* | |
* DO NOT EVER, EVER USE THIS. | |
* | |
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com) | |
* Visit https://gist.github.com/767982 for more information and changelogs. | |
* Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog | |
* Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors | |
* |
/* | |
Template | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/2.3.22/rx.all.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> |
import { enableProdMode, NgModule, ApplicationRef, provide, ExceptionHandler } from '@angular/core'; | |
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | |
import { BrowserModule } from '@angular/platform-browser'; | |
import { Http, XHRBackend, RequestOptions, HttpModule } from '@angular/http'; | |
import { RouterModule } from '@angular/router'; | |
import { LocationStrategy, HashLocationStrategy } from '@angular/common'; | |
import { routing } from './app/app.routing'; | |
import { removeNgStyles, createNewHosts } from '@angularclass/hmr'; | |
import * as pages from './app'; | |
import * as components from './app/shared/components'; |
module App { | |
export class BaseController<T extends Entity> { | |
// my services | |
searchService: SearchService; | |
saveService: SaveService; | |
authService: AuthService; | |
url: UrlService; | |
// my variables | |
searchRequest: SearchRequest; |
// encode(decode) html text into html entity | |
var decodeHtmlEntity = function(str) { | |
return str.replace(/&#(\d+);/g, function(match, dec) { | |
return String.fromCharCode(dec); | |
}); | |
}; | |
var encodeHtmlEntity = function(str) { | |
var buf = []; | |
for (var i=str.length-1;i>=0;i--) { |
// assumes you add a timestamp field to each record (see Firebase.ServerValue.TIMESTAMP) | |
// pros: fast and done server-side (less bandwidth, faster response), simple | |
// cons: a few bytes on each record for the timestamp | |
var ref = new Firebase(...); | |
ref.orderByChild('timestamp').startAt(Date.now()).on('child_added', function(snapshot) { | |
console.log('new record', snap.key()); | |
}); |
Microsoft’s navigator.msLaunchUri method only works in Internet Explorer on Windows 8. Therefore I came up with a (nearly) cross-browser implementation that uses the native msLaunchUri
when it’s available and falls back to adventurous hacks when running in other browsers.
launchUri (uri, successCallback, noHandlerCallback, unknownCallback)
aFunctionThatReturnPromise({ shiftid: event.shiftId, status: 'approve' }) | |
.done(function () { | |
//Do somehting when the promise succeeds | |
}) | |
.fail(failHandler); | |
//Common function for fail handling | |
function failHandler(msg, res){ | |
alert(msg); |
<staticContent> | |
<mimeMap fileExtension=".woff2" mimeType="font/x-woff" /> | |
</staticContent> |