A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
import json | |
import cfnresponse | |
import boto3 | |
from botocore.exceptions import ClientError | |
client = boto3.client("logs") | |
def PutPolicy(arn,policyname): | |
response = client.put_resource_policy( | |
policyName=policyname, |
package extensions | |
trait AngularJsAware { | |
boolean isAngularReady() { | |
js.exec('window.MYAPP.waitForAngular();'); | |
waitFor { | |
js.MYAPP.APP_READY == true | |
} |
Working on Grails 3 I realized that I no longer can specify external configuration using the standard grails.config.locations
property in Config.groovy
file.
Reason is obvious! There is no Config.groovy
now in Grails 3. Instead we now use application.yml
to configure the properties. However, you can't specify the external configuration using this file too!
What the hack?
Now Grails 3 uses Spring's property source concept. To enable external config file to work we need to do something extra now.
@Grab(group='com.github.groovy-wslite', module='groovy-wslite', version='1.1.0') | |
@Grab(group='joda-time', module='joda-time', version='2.7') | |
import wslite.rest.* | |
import org.joda.time.* | |
import org.joda.time.format.* | |
import groovy.xml.* | |
import groovy.json.* | |
import static java.lang.System.* | |
import groovy.transform.* |
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
// Bad example of @ForceOverride... enjoy! (?) | |
import groovy.transform.* | |
class BasicIntQueue extends LinkedList<Integer> { | |
Integer get() { | |
this.poll() | |
} | |
void put( Integer x ) { |
@Grab("org.grails:gorm-mongodb-spring-boot:1.0.0.RC1") | |
import grails.persistence.* | |
import grails.mongodb.geo.* | |
import org.bson.types.ObjectId | |
import com.mongodb.BasicDBObject | |
import org.springframework.http.* | |
import org.springframework.beans.factory.annotation.Autowired | |
import static org.springframework.web.bind.annotation.RequestMethod.* | |
@RestController |
import org.grails.gradle.plugin.GrailsTask | |
apply plugin: 'grails' | |
grails { | |
grailsVersion '2.2.1' | |
} | |
buildscript { | |
repositories { |
function go() { | |
var userId = prompt('Username?', 'Guest'); | |
checkIfUserExists(userId); | |
} | |
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users'; | |
function userExistsCallback(userId, exists) { | |
if (exists) { | |
alert('user ' + userId + ' exists!'); |