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
function toType(obj) { | |
var systype = ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1]; | |
if (systype === "Object") { | |
/** | |
* See if this is a custom user type, a la: | |
* function Foo() {} | |
* foo = new Foo(); | |
* toType(foo); // returns "Foo" | |
* toType(Foo); // returns "Function" | |
*/ |
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
# For SCSS-Lint v0.31.0 | |
linters: | |
BangFormat: | |
enabled: true | |
space_before_bang: true | |
space_after_bang: false | |
BorderZero: |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
<title>Stripe Getting Started Form</title> | |
<!-- The required Stripe lib --> | |
<script type="text/javascript" src="https://js.stripe.com/v2/"></script> | |
<!-- jQuery is used only for this example; it isn't required to use Stripe --> |
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
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$(window).load(function(){ | |
$().hatchShow(); | |
}); | |
jQuery.fn.hatchShow = function(){ | |
$('.hsjs').css('display','inner-block').css('white-space','pre').each(function(){ | |
var t = $(this); | |
t.wrap("<span class='hatchshow_temp' style='display:block'>"); | |
var pw = t.parent().width(); |
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
server { | |
include /home/webmaster/www/codeable.io.conf; | |
server_name codeable.io; | |
listen 443 ssl spdy default_server; | |
root /home/webmaster/www/codeable.io; | |
index index.php index.html; | |
error_log /var/log/nginx/codeable.io.error.log warn; |
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
<?php | |
/** | |
* Add WP API endpoint for form submission, then create new | |
* Gravity Forms entry and send notifications. | |
*/ | |
// rest api endpoint for forms submission | |
add_action( 'rest_api_init', function () { | |
register_rest_route( 'ahr/v1', '/forms', array( | |
'methods' => 'POST', |
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
jQuery(document).ready(function($){ | |
$('body').on( 'click', '.some-button', function(){ | |
$.ajax( ajax_endpoint_data.api_url, { | |
type : 'POST', | |
dataType : 'json', | |
data : { | |
action: 'ajax_action', | |
some_data: 'some_value' | |
} |
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
<?php | |
// reference https://github.com/WP-API/WP-API/blob/develop/lib/infrastructure/class-wp-rest-server.php | |
// serve_request() function | |
add_filter( 'rest_pre_serve_request', 'multiformat_rest_pre_serve_request', 10, 4 ); | |
function multiformat_rest_pre_serve_request( $served, $result, $request, $server ) { | |
// assumes 'format' was passed into the intial API route | |
// example: https://baconipsum.com/wp-json/baconipsum/test-response?format=text |
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
#!/bin/bash | |
for uid in $(wp user list --field=ID) | |
do | |
pass=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32}` | |
wp user update $uid --user_pass="$pass" | |
done |