Skip to content

Instantly share code, notes, and snippets.

View pyrello's full-sized avatar

Sean Adams-Hiett pyrello

View GitHub Profile
@cassidoo
cassidoo / base-css.md
Created May 4, 2022 06:37
Base CSS for a plain HTML document

If you don't want to deal with styling a mostly text-based HTML document, plop these lines in and it'll look good:

html {
  font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 1.3em;
  max-width: 40rem;
  padding: 2rem;
  margin: auto;
 line-height: 1.5rem;
@radheymkumar
radheymkumar / Access field value for a node in Drupal
Created October 22, 2019 12:08
Access field value for a node in Drupal
use Drupal\node\Entity\Node
Working with nodes Load a node by NID:
$nid = 123; // example value
Method 1
$node_storage = \Drupal::entityTypeManager()->getStorage('node');
$node = $node_storage->load($nid);
Method 2
@alexej-d
alexej-d / .babelrc
Created September 22, 2017 08:58
Drupal 8 theme development with Webpack, SASS, ES6 and BrowserSync serving
{
"presets": ["es2015"],
"plugins": ["transform-async-to-generator"]
}
@Towerful
Towerful / RelationalStore.js
Last active May 24, 2018 12:48
Relational Model Store for Vue.js
import Vue from 'vue';
export default class RelationalStore {
/**
* @param {object} options
*/
constructor(options) {
this._options = options;
this.state = {};
@danharper
danharper / a-FormatController.php
Last active August 1, 2017 12:06
A Laravel Controller which allows you to display API/report data in multiple formats. For example, you may display a preview as HTML, and offer buttons to download as CSV and JSON.
<?php
// this is the base controller which parses output to HTML/CSV/JSON depending on the format in the URL
use Illuminate\Support\Collection;
class FormatController extends Controller {
protected $fileName = 'export';
protected $view = 'reports.output';
@garagesocial
garagesocial / filters.php
Last active February 6, 2023 04:11 — forked from zmsaunders/filters.php
Laravel Filter Helper - Compress HTML Output & Strip Comments
<?php
### --- Snip --- ###
App::after(function($request, $response)
{
// HTML Minification
if(App::Environment() != 'local')
{
if($response instanceof Illuminate\Http\Response)
Installing Barracuda and Octopus
$ cd;wget -q -U iCab http://files.aegir.cc/BOA.sh.txt;bash BOA.sh.txt
$ boa in-head public server.mydomain.org my@email o1
Now simply watch the progress and choose some platforms to include. Done!
And how to upgrade Barracuda and all Octopus instances?
$ barracuda up-head
@winmillwill
winmillwill / gist:2410110
Created April 18, 2012 00:32
provision-install error
$ drush provision-save '@dev01.airbox.ld' --context_type='site' --uri='dev01.airbox.ld' --platform='@platform_drupal712' --server='@server_master' --db_server='@server_master' --profile='default' --client_name='admin'
$ cat ~/.drush/dev01.airbox.ld.alias.drushrc.php
<?php
$aliases['dev01.airbox.ld'] = array (
'context_type' => 'site',
'platform' => '@platform_drupal712',
'server' => '@server_master',
'db_server' => '@server_master',