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
public class Foo { | |
Foo() { | |
System.out.println("Creating foo..."); | |
} | |
//Public inner class | |
public class Bar { | |
Bar() { | |
System.out.println("Creating bar..."); |
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 Application { | |
public void do() { | |
Foo foo = new Foo(); | |
Foo.Bar bar = foo.new Bar(); | |
} | |
} |
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 Application { | |
public void do() { | |
def foo = new Foo(); | |
def bar = new Bar(foo); | |
} | |
} |
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
interface Buyable { | |
def buy() | |
} | |
class UpperClass {} | |
class ChildClass extends UpperClass {} | |
class SomeBuyableObject extends UpperClass implements Buyable { | |
String foo | |
def buy() { //do stuff } |
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 grails.util.Environment | |
class MyGrailsPlugin { | |
/* plugin definitions */ | |
def doWithSpring = { | |
loadPluginConfig(application.config) | |
} | |
/** |
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
'use strict'; | |
angular.module('myModule', []) | |
.factory('bootstrap4ElementModifier', ['$log', function($log) { | |
var customCss = [ | |
'<style>' + | |
'.glyphicon-spin-jcs {' + | |
'-webkit-animation: spin 1000ms infinite linear;' + | |
'animation: spin 1000ms infinite linear;' + | |
'}' + |
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
mockedFactory = { | |
getString: jasmine.createSpy() | |
}; | |
$provide.value('gettextCatalog', mockedFactory); |
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
'use strict'; | |
/* https://github.com/angular/protractor/blob/master/docs/toc.md */ | |
describe('my app', function() { | |
it('should automatically redirect to /sign-up when location hash/fragment is empty', function() { | |
browser.get('index.html'); | |
expect(browser.getLocationAbsUrl()).toMatch("/sign-in"); | |
}); |
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.py | |
import falcon | |
import json | |
class SongsResource: | |
def on_get(self, req, resp): | |
songs = [ | |
{ | |
"title": "Your Song", "artist": "Elton John" |
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
# middlewares/json_translator.py | |
import json | |
import falcon | |
class JSONTranslatorMiddleware(object): | |
def process_request(self, req, resp): | |
if req.content_length in (None, 0): | |
return | |
body = req.stream.read() | |
if not body: |
OlderNewer