This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'open-uri' | |
require 'nokogiri' | |
GPX = <<-GPX | |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<gpx | |
xmlns="http://www.topografix.com/GPX/1/1" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'open-uri' | |
require 'nokogiri' | |
GPX = <<-GPX | |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<gpx | |
xmlns="http://www.topografix.com/GPX/1/1" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rewrite ^/sitemap1.xml.gz /sitemaps/$host/sitemap1.xml.gz last; | |
rewrite ^/sitemap_index.xml.gz /sitemaps/$host/sitemap_index.xml.gz last; | |
# or | |
location /sitemap { | |
# it can be already switched on for globally | |
# gzip_static on; | |
rewrite ^/sitemap.xml /sitemaps/$host/sitemap.xml last; # that's will catch .gz files and served as normal static file, but with gzip header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'set' | |
USED_CASSETTES = Set.new | |
module CassetteReporter | |
def insert_cassette(name, options = {}) | |
USED_CASSETTES << VCR::Cassette.new(name, options).file | |
super | |
end | |
end | |
VCR.extend(CassetteReporter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in ./*.JPG ; do recoverjpeg -m 100m -o ./fixed/ -f ${f%.JPG}.JPG ${f%.JPG}.JPG ; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I'm developing this now as a part of substance (https://github.com/michael/substance) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= form_for @search, url: collection_path, | |
as: :q, | |
builder: ActiveAdmin::Filters::CustomFormBuilder, | |
html: {method: :get, class: :filter_form} do |f| | |
= f.input :code_contains, as: :string | |
= f.input :code_contains, as: :filter_string | |
= f.form_buffers.last |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
const { promisify } = require('util') | |
const CDP = require('chrome-remote-interface') | |
const debug = require('debug')('cypress:server:protocol') | |
const rimraf = promisify(require('rimraf')) | |
let port = 0 | |
let client = null | |
module.exports = (on, config) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module UnionScopeConcern | |
extend ActiveSupport::Concern | |
class_methods do | |
def union_scope(*scopes) | |
scopes[1..-1].inject(where(id: scopes.first)) { |all, scope| all.or(where(id: scope)) } | |
end | |
end | |
end |
NewerOlder