Skip to content

Instantly share code, notes, and snippets.

Larry Garfield Crell

Block or report user

Report or block Crell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View command line
$ php -d ffi.enable=preload -d opcache.preload="dummy-preload.php" dummy-test.php
PHP Fatal error: Uncaught FFI\Exception: Failed loading scope 'DUMMY' in /home/crell/temp/php-ffi-test/dummy.php:11
Stack trace:
#0 /home/crell/temp/php-ffi-test/dummy.php(11): FFI::scope()
#1 /home/crell/temp/php-ffi-test/dummy-test.php(7): Dummy->__construct()
#2 {main}
thrown in /home/crell/temp/php-ffi-test/dummy.php on line 11
@Crell
Crell / DoctrineProjectLoad.php
Created Aug 14, 2019
Is this too clever for its own good?
View DoctrineProjectLoad.php
<?php
declare(strict_types=1);
namespace App\EventListener;
use App\Entity\Project;
use App\PlatformClient;
use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
use Psr\Log\LoggerInterface;
use Symfony\Component\Messenger\MessageBusInterface;
View RegionType.php
<?php
declare(strict_types=1);
namespace App\Form\Type;
use App\PlatformClient;
use Platformsh\Client\Model\Region;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\OptionsResolver\OptionsResolver;
View TaskList.js
import { Task } from '../models/Task.js';
import htm from 'https://unpkg.com/htm?module'
const html = htm.bind(m);
function topLevelTasks(task) {
return !task.parent;
}
View TaskList.js
import { Task } from '../models/Task.js';
function topLevelTasks(task) {
return !task.parent;
}
function childOf(task) {
return child => child.parent == task.id;
}
View User.js
// var m = require("mithril");
var User = {
list: [],
loadList: function() {
return m.request({
method: "GET",
url: "https://rem-rest-api.herokuapp.com/api/users",
withCredentials: true,
})
@Crell
Crell / Demo.js
Created May 1, 2019
How to do this?
View Demo.js
async function demo() {
let thing = New Thing();
var output = '';
var count = 0;
thing.on('event', (data) => {
output += data;
if (count++ > 5) {
View build.gradle
/*
* This build file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at https://docs.gradle.org/3.3/userguide/tutorial_java_projects.html
*/
// Apply the java plugin to add support for Java
apply plugin: 'java'
View output
web@5x37plrvz5sze-work-adqt5vy--app:~$ java -jar build/libs/SpringBlog-0.1.jar -Dport.http=8888 -Ddatabase.name=main -Ddatabase.user=user -Ddatabase.pass= -Ddatabase.host=database.internal -Dredis.host=rediscache.internal -Dredis.port=6379 --spring.config.location=application-production.yml -verbose
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/app/build/libs/SpringBlog-0.1.jar!/lib/logback-classic-1.1.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/app/build/libs/SpringBlog-0.1.jar!/lib/slf4j-log4j12-1.7.21.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
View aerys.php
<?php
use Aerys\Host;
use Aerys\Router;
use Kelunik\Demo\Chat;
use function Aerys\root;
use function Aerys\websocket;
// route /ws to the websocket endpoint
// you can add more routes to this router
You can’t perform that action at this time.