Skip to content

Instantly share code, notes, and snippets.

[].every(() => false) === true
[].some(() => true) === false
[] + [] === ""
class Button {
click() {
// TODO Animate the button.
}
}
class RedButton {
button = new Button()
style = {
@BevanR
BevanR / dsf
Last active March 12, 2016 06:07
title = 'Black Seeds'
artist = 'One By One'
itunes_identifier = retrieve_itunes_identifier(title, artist)
if itunes_identifier:
itunes_identifiers.append(itunes_identifier)
print("{} - {} => {}".format(title, artist, itunes_identifier))
else:
print("{} - {} => Not Found".format(title, artist))
@BevanR
BevanR / remember_me.php
Created May 21, 2015 04:02
How to make the "Remember me" checkbox be checked by default in WordPress
<?php
/**
* Makes the "Remember me" checkbox checked by default.
*/
add_filter( 'login_form_defaults', function (array $args) {
$args['value_remember'] = true;
return $args;
} );
--- archetype_quiz.module
+++ (clipboard)
@@ -1,11 +1,11 @@
- // Get the subject UIDs of quiz results:
- $sql = 'SELECT DISTINCT quiz.uid FROM {archetype_quiz_results} quiz
+ // Get the author UIDs of quiz results:
+ $sql = 'SELECT DISTINCT quiz.author FROM {archetype_quiz_results} quiz
-- by users who have not deleted their accounts.
- INNER JOIN {users} u ON quiz.uid = u.uid
- -- by the given user.
Invalid argument supplied for foreach() archetype_messages.email_mandrill_helper.inc:438 [warning]
WD Mandrill: Validation error: {"message":{"to":[{"email":"Sorry, this field can't be left blank."}]}} - Array [error]
WD Mandrill: Mandrill_Exception: Validation error: {"message":{"to":[{"email":"Sorry, this field can't be left [error]
blank."}]}} - Array in Mandrill->request() (line 114 of
/var/www/archetypes/git_working/sites/all/modules/contrib/mandrill/lib/mandrill.inc).
Invalid argument supplied for foreach() archetype_messages.email_mandrill_helper.inc:1203 [warning]
WD Mandrill: Validation error: {"message":{"to":[{"email":"Sorry, this field can't be left blank."}]}} - Array [error]
WD Mandrill: Mandrill_Exception: Validation error: {"message":{"to":[{"email":"Sorry, this field can't be left [error]
blank."}]}} - Array in Mandrill->request() (line 114 of
/var/www/archetypes/git_working/sites/all/modules/contrib/ma
@BevanR
BevanR / gist:9991e3c87376474c0755
Created May 14, 2014 20:30
Toggles the display of all outdated comments on GitHub pull requests.
jQuery('.discussion-item-toggle-closed').click();