Skip to content

Instantly share code, notes, and snippets.

View Jaesin's full-sized avatar

Jaesin Mulenex Jaesin

View GitHub Profile
@Jaesin
Jaesin / FancyService.php
Created May 15, 2017 16:02
Autowiring services in Drupal 8
<?php
/**
* @file `src/FancyService.php`
*
* Fancy service provides lyric segments from Iggy Azalea's song, "Fancy".
*/
namespace Drupal\example;
use Drupal\Core\Language\LanguageManagerInterface;
@Jaesin
Jaesin / ExampleHomepageResolverTest.php
Last active January 10, 2022 18:37
Example Dynamic node route in drupal 8.
<?php
/**
* @file `tests/src/Kernel/ExampleHomepageResolverTest.php`
*
* Provides kernel tests for the HomepageEnhancer.
*/
namespace Drupal\Tests\example\Kernel;
use Drupal\Core\Datetime\DrupalDateTime;
@Jaesin
Jaesin / jupyter-nginx-proxy.conf
Created November 27, 2016 02:09
Nginx config to create a proxy for jupyter notebook running on :8885
server {
listen *:80;
server_name jupyter.l;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:8885;
}
}
@Jaesin
Jaesin / d8-scrapbook.php
Last active October 2, 2016 09:46
Drupal 8 scrap book
<?php
// Load the autoloader.
$autoloader = !isset($autoloader) ? $autoloader : require_once '/path/to/drupal_root/autoload.php';
// Bootstrap drupal.
$request = \Symfony\Component\HttpFoundation\Request::createFromGlobals();
$kernel = \Drupal\Core\DrupalKernel::createFromRequest($request, $autoloader, 'prod');
// There are a couple of files not loaded by the autoloader.
$kernel->loadLegacyIncludes();
[profile]
layer_height = 0.2
wall_thickness = 0.7
retraction_enable = True
solid_layer_thickness = .6
fill_density = 100
print_speed = 60
print_temperature = 187
print_temperature2 = 200
print_temperature3 = 0
@Jaesin
Jaesin / zim-oprint.sh
Last active March 19, 2016 06:22
Zeepro zim Install OctoPrint
#!/bin/bash
# Run as root. If using sudo, use "sudo -i -u root"
# This script is for building octoprint on a zim cubieboard.
# I have since moved to building a binary version of octoprint in an armhf qemu vm.
# I am using a build virtual machine to build octoprint. Qemu immulates armhf and
# is used to hostthe build machine.
#
# Debian Wheezy armhf images were obtained from: https://people.debian.org/~aurel32/qemu/armhf/
@Jaesin
Jaesin / zeepro-bootstrap.sh
Last active March 3, 2016 23:11
Zeepro Zim provisioning bash script.
#!/bin/bash
# This script is for initializing a zim and installing a pre-compiled version of octoprint.
# Run as root. If using sudo, use "sudo -i -u root"
echo "Making root writable"
mount -o remount,rw /
echo "Add some aliases for root."
@Jaesin
Jaesin / config-snaphot.php
Last active October 13, 2015 21:27
Rebuild Config Snapshot.
<?php
/**
* Creates a new snapshot of the current state of configuration.
*/
\Drupal::service('config.manager')->createSnapshot(\Drupal::service('config.storage'), \Drupal::service('config.storage.snapshot'));
@Jaesin
Jaesin / .travis.yml
Last active January 12, 2017 21:27
Working Travis CI file for D8 with specific simpletest suport.
# @file
# .travis.yml - Drupal 8 Travis CI Integration
language: php
sudo: false
env:
global:
# The name of the moduel to run tests on (this module).
- DRUPAL_MODULE=example
@Jaesin
Jaesin / drupal-8.conf
Last active April 20, 2021 16:13
Drupal 8 Nginx configuration
# @file
# NGINX Configuration file for Drupal 8
# Redirect index to php.
location / {
try_files $uri @rewrite;
}
# Allow but don't log access to /favicon.ico and /robots.txt
location ~ (^/favicon\.ico$|^/robots\.txt$) {