Ubuntu 16.04
/etc/systemd/system/certbot.service
[Unit]
Description=Let's Encrypt renewal
[Service]
Type=oneshot
ExecStart=/usr/bin/certbot renew --quiet --agree-tos
# inspired by https://gist.github.com/rjnienaber/af47fccb8410926ba7ea35f96c3b87fd | |
# remove bundled ImageMagick | |
sudo apt remove imagemagick -y | |
# install base dependencies | |
sudo apt-get install -y \ | |
build-essential \ | |
git \ | |
libde265-dev \ |
export function classnamePrefixPlugin() { | |
const prefix = 'tw-' | |
return { | |
name: 'classname-prefix', | |
transform: (code: string, id: string) => { | |
const classNamePattern = /(className|class)\s*(:|=)\s*"([^"]*)"/g | |
const transformedCode = code.replace(classNamePattern, (match, p1, p2, p3) => { | |
const transformedClassName = p3 | |
.split(' ') |
Ubuntu 16.04
/etc/systemd/system/certbot.service
[Unit]
Description=Let's Encrypt renewal
[Service]
Type=oneshot
ExecStart=/usr/bin/certbot renew --quiet --agree-tos
require 'net/http' | |
require 'json' | |
require 'uri' | |
require 'yaml' | |
## | |
# Make a certain obfuscated js less obnoxious to analyze. | |
# | |
class Obfuscated | |
attr_accessor :script |
#Simple form Input class for arrays | |
class ArrayInput < SimpleForm::Inputs::Base | |
def input(_wrapper_options) | |
#override the attribute name for arrays to allow rails to handle array forms | |
input_html_options.merge!({:name => "#{self.object_name}[#{attribute_name}][]"}) | |
@builder.text_field(attribute_name, input_html_options) | |
end | |
end |
page.driver.browser.manage.window.resize_to(1600, 1800) | |
page.save_and_open_screenshot('screen.png', full: true) |
Benchmark.ips do |x| | |
x.config(time: 30, warmup: 2) | |
x.report('gsub') { string.gsub(/ /, '') } | |
x.report('gsub, no regex') { string.gsub(' ', '') } | |
x.report('tr') { string.tr(' ','') } | |
x.report('delete') { string.delete(' ') } | |
x.compare! | |
end |
import glob from 'fast-glob' | |
import nodeURL from 'url' | |
import process from 'process' | |
/** Returns pathnames matching the given pattern. */ | |
const sync = (source: string) => glob.sync(source, options()) as string[] | |
/** Returns pathnames matching the given pattern. */ | |
const async = (source: string) => glob(source, options()) as Promise<string[]> |
class MigrateHstoreToJson < ActiveRecord::Migration | |
def up | |
rename_column :posts, :data, :data_hstore | |
add_column :posts, :data, :jsonb, default: {}, null: false, index: { using: 'gin' } | |
execute 'UPDATE "posts" SET "data" = json_object(hstore_to_matrix("data_hstore"))::jsonb' | |
remove_column :posts, :data_hstore | |
end | |
def down | |
rename_column :posts, :data, :data_jsonb |
function getYAML() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var dest = DocumentApp.openById(PropertiesService.getScriptProperties().getProperty("output_document_id")); | |
var key = Browser.inputBox("Please enter the key of the Google Spreadsheet containing the content to be generated as a YAML file."); | |
var source = SpreadsheetApp.openById(key); | |
var output = "---\nen:\n"; | |
var sheets = source.getSheets(); | |
for (var i = 0; i < sheets.length; i++) { |