This file contains hidden or 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
// Based heavily on https://bitbucket.org/zombiezen/spdy, adapted for | |
// recent Go releases. | |
package main | |
import ( | |
"crypto/tls" | |
"fmt" | |
"go.net/spdy" | |
"io" |
This file contains hidden or 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 Domain < Sequel::Model | |
def before_save | |
model.dataset.filter(id: self.id).update(txid: :txid_current.sql_function) | |
super | |
end | |
end |
This file contains hidden or 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 Sequel | |
module Plugins | |
# The paranoia plugin creates hooks that automatically set deleted | |
# timestamp fields. The field name used is configurable, and you | |
# can also set whether to overwrite existing deleted timestamps (false | |
# by default). Adapted from Timestamps plugin. | |
# | |
# Usage: | |
# | |
# # Soft deletion for all model instances using +deleted_at+ |
This file contains hidden or 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
def tagged_with(tags, options = {}) | |
tag_list = ActsAsTaggableOn::Taggable::TagList.from(tags) | |
joins = [] | |
conditions = [] | |
context = options.delete(:on) | |
context_condition = context.blank? ? "" : sanitize_sql(["AND #{acts_as_taggable_on_tagging_model.table_name}.context = ?", context.to_s]) | |
if options.delete(:exclude) |
This file contains hidden or 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 Dir | |
def self.glob_without(pattern, regexp, directory = pwd) | |
chdir(directory) do | |
glob(pattern).reject {|i| i =~ regexp }.map {|i| File.expand_path(i) } | |
end | |
end | |
end |
This file contains hidden or 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 'dm-core' | |
require 'active_model' | |
module ActiveModel | |
module MassAssignmentSecurity | |
module Sanitizer | |
# Returns all attributes not denied by the authorizer. | |
def sanitize(attributes) | |
sanitized_attributes = attributes.reject do |key, value| | |
key_name = key.name rescue key |
This file contains hidden or 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
diff --git a/libavcodec/resample.c b/libavcodec/resample.c | |
index b008180..b4fa9e6 100644 | |
--- a/libavcodec/resample.c | |
+++ b/libavcodec/resample.c | |
@@ -52,6 +52,17 @@ struct ReSampleContext { | |
unsigned buffer_size[2]; ///< sizes of allocated buffers | |
}; | |
+/* | |
+*/ |
NewerOlder