Skip to content

Instantly share code, notes, and snippets.

View juiceByStaplez's full-sized avatar

Matthew McKey juiceByStaplez

View GitHub Profile
@juiceByStaplez
juiceByStaplez / 0_reuse_code.js
Created November 14, 2013 16:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
insta_patient_finder = {
init: function() {
$('#patient-finder input').focusout(function() {
insta_patient_finder.search();
});
},
search: function() {
var p_fname = $('#p_fname').val();
var p_lname = $('#p_lname').val();
var p_dob = $('#p_dob').val();
if($appt_day == null || $appt_time == null) {
if($appt_referred !== null && $appt_notes !== null) {
$update = $wpdb->update('ea_appts',
array(
'referral' => $appt_referred,
'notes' => $appt_notes,
'updated_by' => $user_id
), array('id' => $appt_id)
);
} else if($appt_referred == null) {
$.post('http://instasandbox.com/wp/wp-login.php', r, function() {
if(r['appt-form']) {
$.post('inc/functions/_post/patient.php', {
action: 'survey-check',
doctor_id: '144'
}, function(r) {
data = $.parseJSON(r);
console.log(data.survey);
if(data.survey == false) {
window.location.href = 'home?p=survey';
<!DOCTYPE html>
<html>
<head>
<title>Image Loader</title>
</head>
<body>
<div class="container">
<input type="text" name="img_url" id="img_url" />
<button id="loadImg">Load</button>
<canvas id="selectedImg" width="640" height="480"></canvas>
/**
* Polls for an HTML element until DOM ready
*
* @param {String} selector - Any valid jQuery selector
* @param {Function} callback - A callback function to run once the selected element has been found
* @param {Number} [interval=50] - Integer representing the polling interval in milliseconds
*/
export function when(selector, callback, interval = 50) {
if(typeof $ === 'undefined' && typeof jQuery === 'function') {
$ = jQuery;
# A class that knows how to calculate the discount for a line item, given a
# number of cents to discount each unit of item by.
class MoneyDiscount
def initialize(cents)
@amount = Money.new(cents: cents)
end
def calculate(line_item)
@amount * line_item.quantity
end
const fs = require("fs");
const axios = require("axios");
const Promise = require("bluebird");
const _ = require("lodash");
const API_BASE =
"https://www.easports.com/madden-nfl/ratings/service/data?entityType=madden19_player&limit=160&";
let params = ["offset=0", "filter=iteration:1"];
const total = 2367;
const limit = 160;

Keybase proof

I hereby claim:

  • I am juicebystaplez on github.
  • I am juicebys (https://keybase.io/juicebys) on keybase.
  • I have a public key ASAoyyLcz-9G98iNiatlbj4QKGfFhoOTT7pBbYS9r6Q-ewo

To claim this, I am signing this object: