Skip to content

Instantly share code, notes, and snippets.

@facine
facine / __INDEX.txt
Last active August 6, 2023 15:33
Drupal 8 - Examples
# Taxonomy terms:
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_taxonomy_term-php
# Menu links:
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_menu_link-php
# File items:
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_file-php
# Nodes:
@michaelkoper
michaelkoper / backbone_pushstate_router.js
Last active October 5, 2016 21:28 — forked from tbranyen/backbone_pushstate_router.js
hijack links for pushState in Backbone. With open in new tab functionality.
// Use absolute URLs to navigate to anything not in your Router.
var openLinkInTab = false;
// Only need this for pushState enabled browsers
if (Backbone.history && Backbone.history._hasPushState) {
$(document).keydown(function(event) {
if (event.ctrlKey || event.keyCode === 91) {
openLinkInTab = true;
@silverjam
silverjam / AddHeaderNumbers.js
Last active September 28, 2016 19:25
Google apps script to add header numbers to a document
var state = {
headerLevel1: 0,
headerLevel2: 0,
headerLevel3: 0,
}
var private = {
getSectionNumber: function (paragraph)
{
if ( paragraph.getHeading() == DocumentApp.ParagraphHeading.HEADING1 )
@sshtmc
sshtmc / ubuntu-configure-sendmail-with-gmail
Created October 25, 2012 12:24
Ubuntu sendmail using smtp.gmail.com
#!/bin/bash
HOST=$(hostname)
function install_postfix() {
echo | sudo debconf-set-selections <<__EOF
postfix postfix/root_address string
postfix postfix/rfc1035_violation boolean false
postfix postfix/mydomain_warning boolean
postfix postfix/mynetworks string 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128