Find value using array of objects with id or other property.
In the controller:
from __future__ import print_function | |
import numpy as np | |
import matplotlib.pyplot as plt #conda install matplotlib | |
# -40 65.33333333 | |
# -30 99.66666667 | |
# -20 130 | |
# -10 175.3333333 | |
# 0 383.6666667 | |
# 10 446.3333333 |
from __future__ import print_function | |
import numpy | |
# Save this file using file save in your browser | |
# Do not copy paste into PyCharm as it will mess up the indentation | |
# and thus your code will not run properly. | |
# Print Hangman's current state | |
def printHangman(numberWrong): | |
# Print the hangman |
<?php | |
use GuzzleHttp\Client; | |
use GuzzleHttp\Exception\ConnectException; | |
use GuzzleHttp\Exception\RequestException; | |
use GuzzleHttp\Handler\CurlHandler; | |
use GuzzleHttp\HandlerStack; | |
use GuzzleHttp\Psr7\Request as Psr7Request; | |
use GuzzleHttp\Psr7\Response as Psr7Response; | |
use Psr\Log\LoggerInterface; | |
const MAX_RETRIES = 2; |
txtblk='\e[0;30m' # Black - Regular | |
txtred='\e[0;31m' # Red | |
txtgrn='\e[0;32m' # Green | |
txtylw='\e[0;33m' # Yellow | |
txtblu='\e[0;34m' # Blue | |
txtpur='\e[0;35m' # Purple | |
txtcyn='\e[0;36m' # Cyan | |
txtwht='\e[0;37m' # White | |
bldblk='\e[1;30m' # Black - Bold |
<?php | |
/** | |
* Twilio Request Validator Class | |
* This file goes in app/Models/Twilio (or you can move it around and change the namespace) | |
* It requires that you have a file config/api.php | |
* Source: https://raw.githubusercontent.com/twilio/twilio-php/3d02ee1f1bde8e860e7dbfd9d2d0d2b7ca7d625c/Services/Twilio/RequestValidator.php | |
*/ | |
namespace App\Models\Twilio; |
#!/bin/bash | |
set -e | |
branch=$(git rev-parse --abbrev-ref HEAD) | |
stash=false; | |
if ! git diff-index --quiet HEAD --; then | |
stash=true | |
git stash | |
fi |
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Session; | |
class SessionTimeout | |
{ |
To make composer install
run after a pull to make sure your versions of things are update date,
add this git hook https://gist.github.com/loren138/7038d20d32c206c82393
Upon downloading the API, you will need to run composer install
to install the vendor files.
This also means that if you update or add a composer dependency eg (composer require
or composer update
)
that you will need to let others know to rerun composer install
on their personal machines.
Note: The deploy scripts take care of running composer during the deploy process. (See the rocketeer files here: https://gist.github.com/loren138/27d9f53a4dfb3df206dd)
{"query":{"function_score":{"query":{"multi_match":{"query":"yoga","type":"most_fields","fields":["title^10","title.std","title.shingles","authors^10","language^10","description^10","description.std","description.shingles","transcript^10","transcript.std","transcript.shingles","scripture^10","tags^10","origin_id^10"]}},"functions":[{"gauss":{"date_created":{"origin":"now\/d","scale":"50w","offset":"4w","decay":"0.5"}}}]}},"_source":{"exclude":["transcript","segments.*"]},"size":"10"} |