Skip to content

Instantly share code, notes, and snippets.

View carlwiedemann's full-sized avatar

Carl Wiedemann carlwiedemann

View GitHub Profile
#!/bin/bash
# Daisydiff script based on https://gist.github.com/c4rl/5385704 for unix users
# Required folder structure:
# - this script
# - daisydiff folder
# - tmp folder
# CONFIGURATION
USERNAME=youruser
@joelpittet
joelpittet / attributes-count
Created May 25, 2013 16:36
List of all the template files uses of attributes, title_attributes and content_attributes in d8
Drupal 8 Stats as of May 24th, 2013
`title_attributes` used in 12 templates or theme functions.
`content_attributes` used in 9 templates or theme functions and assumed existance in rdf.
`attributes` used in 35 templates or theme functions.
## Title Attributes
```
core/modules/block/templates/block.html.twig:
@lewisnyman
lewisnyman / gist:5651296
Created May 26, 2013 00:22
template_preprocess_html
/**
* Prepares variables for HTML document templates.
*
* Default template: html.html.twig.
*
* @param array $variables
* An associative array containing:
* - page: A render element representing the page.
*
* @see system_elements()
<?php
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
register_shutdown_function(function () {
$namespace = 'sitename';
$filename = '/tmp/' . uniqid() . '.' . $namespace . '.xhprof';
file_put_contents($filename, serialize(xhprof_disable()));
});
@lfender6445
lfender6445 / gist:9919357
Last active May 12, 2024 19:09
Pry Cheat Sheet

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@brenopolanski
brenopolanski / merge-pdf-ghostscript.md
Last active May 2, 2024 06:56
Merge multiple PDFs using Ghostscript

A simple Ghostscript command to merge two PDFs in a single file is shown below:

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH 1.pdf 2.pdf

Install Ghostscript:

Type the command sudo apt-get install ghostscript to download and install the ghostscript package and all of the packages it depends on.

@taylorotwell
taylorotwell / global-homestead.sh
Created September 23, 2015 21:40
Global Homestead Without Composer
alias homestead='function __homestead() { (cd ~/Documents/Code/Homestead && vagrant $*); unset -f __homestead; }; __homestead'
# Usage
homestead up
homestead halt
# etc...
@t-mart
t-mart / netrw quick reference.md
Last active May 19, 2024 06:18
A quick reference for Vim's built-in netrw file selector.
Map Action
<F1> Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file
<del> Netrw will attempt to remove the file/directory
- Makes Netrw go up one directory
a Toggles between normal display, hiding (suppress display of files matching g:netrw_list_hide) showing (display only files which match g:netrw_list_hide)
c Make browsing directory the current directory
C Setting the editing window
d Make a directory
@subfuzion
subfuzion / curl.md
Last active May 16, 2024 18:04
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@phansch
phansch / yardoc_cheatsheet.md
Last active March 1, 2024 18:17 — forked from chetan/yardoc_cheatsheet.md
Improved YARD cheatsheet