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
WickedPdf.config ||= {} | |
WickedPdf.config.merge!({}) | |
if Rails.env.development? && ENV["WICKED_PDF_WORKAROUND"] == "fedora" | |
WickedPdf.config.merge!( | |
{ | |
exe_path: File.expand_path( | |
"~/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/wkhtmltopdf-binary-0.12.6.5/bin/wkhtmltopdf_centos_8_amd64" | |
), | |
enable_local_file_access: true |
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
```js | |
function handleUploadProgress(event) { | |
//... | |
} | |
function handleDownloadProress(event) { | |
//... | |
} | |
function prepareXHR() { |
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
xinput --set-prop "Logitech USB Laser Mouse" "Device Accel Velocity Scaling" 1 | |
xinput --set-prop "Logitech USB Laser Mouse" "Device Accel Constant Deceleration" 1.0 |
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
function logIt(it) { | |
console.log(it); | |
} | |
ajaxOptions = { | |
url: 'http://myrequest.com/?param1=true¶m2=false', | |
dataType: 'jsonp', | |
jsonpCallback: 'logIt' | |
} |
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
class Decorator | |
# Uncomment for Rails | |
# | |
# include ActionView::Helpers::UrlHelper | |
attr_reader :decorated | |
def initialize(decorated) | |
@decorated = decorated | |
init_hook |
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
# By extending a regular ruby hash with this module the hash will behave as if | |
# it were an immutable object. The brackets and fetch methods will return copies | |
# of values and the assignment method will raise an exception. | |
# | |
# Other methods that should be redefined for a truly immutable hash object. | |
# :delete, :delete_if, :reject!, :select!, :keep_if, :merge!, :update | |
module ReadOnlyHash | |
def [](key) | |
value = super(key) | |
value ? value.dup : default |