Skip to content

Instantly share code, notes, and snippets.

View travis-bradbury's full-sized avatar

Travis Bradbury travis-bradbury

View GitHub Profile
@travis-bradbury
travis-bradbury / gist:fd922f69485716802e4c59d558e8bae3
Created April 16, 2019 21:56
A Drupal Commerce 2.x tax rate resolver example
mymodule.services.yml
Define a tax resolver plugin with a priority higher than the default tax resolver.
```
services:
mymodule.tax_resolver:
class: Drupal\mymodule\Resolver\TaxResolver
tags:
- { name: commerce_tax.tax_rate_resolver, priority: 100 }
<?php
function ok($value) {
return new Result('ok', $val);
}
function err($value) {
return new Result('err', $val);
}
#!/bin/sh
### BEGIN INIT INFO
# Provides: php7-fpm
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts php7-fpm
# Description: Starts The PHP FastCGI Process Manager Daemon
### END INIT INFO
@travis-bradbury
travis-bradbury / challenge1.rs
Last active April 19, 2016 00:00
Cryptopals set1/challenge1 main.rs
extern crate rustc_serialize;
/// Converts its argument from hex to base64.
///
/// # Examples
/// `$ challenge1 "af"`
fn main() {
let args: Vec<String> = std::env::args().collect();
let input: &String = match args.get(1) {
Some(x) => x,