attributes | relationships | ||||||||
---|---|---|---|---|---|---|---|---|---|
|
This file contains hidden or 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 { execute, call } from 'effection'; | |
// One of the things that struck me was that when I was doing the | |
// implementation for the `enqueue` function in the task constraining | |
// functions | |
// (https://gist.github.com/cowboyd/19122da0c59c674cdea86cf6d70e9c75), | |
// was the eventual form it took. | |
// | |
// Like the other task constructors, it returned a function. Let's |
This file contains hidden or 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 { pipe as $, string, preventDefault, blockOn } from 'react-event-pipeline' | |
function onSubmit(form) { | |
return $(preventDefault, blockOn(() => form.isSubmittable), onSave(form.serialized)); | |
} | |
export default function Settings({ flares, knotsPerFlare, onSave }) { | |
return ( | |
<State type={Form} value={{ flares, knotsPerFlare }}> | |
{form => { |
This file contains hidden or 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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
myService: Ember.inject.service('my-service'), | |
appName: 'Ember Twiddle' | |
}); |
This file contains hidden or 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
<?php | |
if ( ! preg_match( '#wp-json#', $_SERVER['REQUEST_URI'] ) && ! preg_match( '#wp-content#', $_SERVER['REQUEST_URI'] ) && ! preg_match( '#^www.#', $_SERVER['HTTP_HOST'] ) ) { | |
$https = 443 === $_SERVER['SERVER_PORT'] ? 's' : ''; | |
header( "Location: http{$https}://www.{$_SERVER['HTTP_HOST']}", true, 301 ); | |
die(); | |
} |
This file contains hidden or 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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
queryParams: ['test'], | |
appName:'finalizeQueryParamChange bug example', | |
actions: { | |
set_param() { | |
this.set('test', 'foo'); | |
} |
This file contains hidden or 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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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, this is pretty horrible. If we just encode using btoa, any UTF-8 chars cause an error. | |
# If we use either of the workarounds on MDN[1], the £ sign is encoded wrong. I suspect | |
# Excel totally sucking at encodings is the reason why. So, the workaround is, to use | |
# the MDN workaround on chars with values > 255, and allow chars 0-255 to be encoded | |
# as is with btoa. Note that if you use either of the workarounds on MDN, chars | |
# 128-255 will be encoded as UTF-8, which includeds the £ sign. This will cause excel | |
# to choke on these chars. Excel will still choke on chars > 255, but at least the £ | |
# sign works now... | |
# [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding |
This file contains hidden or 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 empty, get, set, | |
__hasProp = {}.hasOwnProperty; | |
get = Ember.get; | |
set = Ember.set; | |
empty = function(obj) { | |
var key; | |
for (key in obj) { | |
if (!__hasProp.call(obj, key)) continue; |
NewerOlder