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
#include <Adafruit_NeoPixel.h> | |
#include <Adafruit_SI1145.h> | |
Adafruit_NeoPixel pixelCircle = Adafruit_NeoPixel(12, 9, NEO_GRBW + NEO_KHZ800); | |
Adafruit_SI1145 lightSensor = Adafruit_SI1145(); | |
void setup() { | |
pixelCircle.begin(); | |
pixelCircle.setBrightness(50); | |
pixelCircle.show(); |
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 | |
namespace App\Models\Traits; | |
use Carbon\Carbon; | |
use Cron\CronExpression; | |
use InvalidArgumentException; | |
/** | |
* @property CronExpression|null $cron_expression |
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 charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="./styles.css" /> | |
</head> | |
<body> | |
<div class="mx-auto max-width-4"> | |
<h1>Message Commitment</h1> |
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 | |
/** | |
* Takes the results of a relation sync and replaces the ids with model instances. | |
* | |
* @param array $synced The results of a call to `sync()` on a `BelongsToMany` relation. | |
* @param string $foreign Namespaced model name. e.g. from Foo::class | |
* @return array $sync, but with ids replaced with model instances | |
*/ | |
function fetchSynced(array $synced, string $foreign): array |
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 | |
/** | |
* @param string $message | |
* @param int $length | |
* @param string $cap What to place at the end of the truncated message to indicate truncation. | |
* @param string $delimiter | |
* @param bool $removeLastDelimiter | |
* @param bool $lengthInBytes | |
* @param string|null $encoding | |
* @return string |
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 | |
/** | |
* @param array $items | |
* @param callable|int|string|null $callback | |
* @return mixed | |
*/ | |
public static function median($items, $callback = null) | |
{ | |
return static::nthOrder($items, (int) ((count($items) - 1) / 2), $callback); | |
} |
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 gauge() { | |
'use strict'; | |
var settings = { | |
'arc-size': 10, | |
angle: 90.0, // Degrees | |
arcGenerator: d3.svg.arc(), | |
angleScale: d3.scale.linear().range([-45, 45]), // Value to degrees | |
domain: null, // Raw values to that correspond to each color in range. | |
margin: { |
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(root, Sudoku) { | |
'use strict'; | |
/* | |
* Depth-first search tree of the Sudoku board. Should be as good as A*, | |
* since there's no real heuristic to direct the search and give A* an | |
* advantage. | |
*/ | |
root.solveBoard = function(board) { | |
var open = [], |
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(root) { | |
'use strict'; | |
// Mapping of returned interval handles to their current timeout handles | |
var intervals = {}, | |
easedIntervalCounter = 0; | |
var isNumeric = function(candidate) { | |
return (!isNaN(parseFloat(candidate)) && isFinite(candidate)); | |
}, |
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
<IfModule mod_expires.c> | |
ExpiresActive on | |
ExpiresByType image/jpeg A604800 | |
ExpiresByType image/gif A604800 | |
ExpiresByType image/png A604800 | |
ExpiresByType text/css A604800 | |
ExpiresByType application/x-javascript A604800 | |
ExpiresByType application/javascript A604800 | |
ExpiresByType text/javascript A604800 | |
</IfModule> |