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 | |
/** | |
* @group example | |
*/ | |
trait ExampleGroup | |
{ | |
// utility methods here I guess? | |
} |
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
variable "evident_account" { | |
type = "string" | |
} | |
variable "evident_id" { | |
type = "string" | |
} | |
data "aws_iam_policy_document" "evident" { | |
statement { |
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 | |
use Symfony\Component\HttpKernel\Kernel; | |
class AppKernel extends Kernel | |
{ | |
public static function fromEnvironment() | |
{ | |
$env = getenv('APP_ENVIRONMENT') ?: 'prod'; | |
$debug = filter_var(getenv('APP_DEBUG'), FILTER_VALIDATE_BOOLEAN); |
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_filter('page_template', function ($template) { | |
$page = get_queried_object(); | |
$slugs = []; | |
do { | |
$slugs[] = $page->post_name; | |
$page = empty($page->post_parent) ? null : get_post($page->post_parent); | |
} while ($page); |
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 | |
/** | |
* Child theme's function.php. This is loaded *before* the parent theme's so you can | |
* unhook things here as you wish. See: https://github.com/WordPress/WordPress/blob/e9dbea9aac6300550f1637cda24948df65752a68/wp-settings.php#L366-L369 | |
* | |
* STYLESHEETPATH === child theme path | |
* TEMPLATEPATH === parent theme path | |
* | |
* For example, in Ribosome https://wordpress.org/themes/ribosome/ say you didn't like the way |
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 | |
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; | |
use Acme\Example\Auth\AppUser; | |
/** | |
* Replaces the `date` filter with one that uses the user's timezone if a | |
* user is present. | |
*/ | |
final class TimeZoneExtension extends \Twig_Extension |
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 | |
// The return type of a method, imagine this is a | |
// nice value object. | |
final class Foo | |
{ | |
} | |
// interface that returns a `Foo` value object | |
interface Bar |
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
(defn- read-int-line [] | |
(Integer/parseInt (read-line))) | |
(defn- spring? [current-cycle] | |
(= 0 (mod current-cycle 2))) | |
(defn- tree-height-after [total-cycles] | |
(loop [current-cycle 0 | |
height 1] | |
(if (>= current-cycle total-cycles) |
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
(defn- str->int [s] | |
(Integer/parseInt s)) | |
(defn- read-test-case [] | |
(str->int (read-line))) | |
(defn- divisible-by-3 [n] | |
(= 0 (mod n 3))) | |
(defn- decent-number-for [digit-count] |
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
(require '[clojure.string :as string]) | |
(defn- str->int [s] | |
(Integer/parseInt s)) | |
(defn- split-spaces [s] | |
(string/split s #"\s+")) | |
(defn- read-test-case [] | |
(let [[students threshold] (split-spaces (read-line)) |