Skip to content

Instantly share code, notes, and snippets.

@cmrd-senya
cmrd-senya / prepare-commit-message
Last active October 6, 2023 06:54 — forked from jakeonrails/prepare-commit-message
prepare-commit-message that requires a JIRA ID and adds it if the branch name contains one
#!/usr/bin/env ruby
# Git Prepare Commit Message Hook Script
#
# Location: <repository>/.git/hooks/prepare-commit-msg
#
# This script will automatically add the correct
# JIRA ISSUE ID to the end of each commit message
# When the branch ID starts with the JIRA ISSUE ID.
# It can be overridden if specified in the message.
diff --git a/libpeas/meson.build b/libpeas/meson.build
index d32c6b9..f539fc5 100644
--- a/libpeas/meson.build
+++ b/libpeas/meson.build
@@ -27,6 +27,7 @@ libpeas_public_h = files(
'peas-plugin-info.h',
'peas-version-macros.h',
'peas.h',
+ 'peas-plugin-loader.h',
)
@cmrd-senya
cmrd-senya / select_append_no_default_all.rb
Last active July 25, 2018 08:48
Sequel plugin to override default select_append behaviour which adds '*' to select query if there is no prior selections
module Sequel::Plugins::SelectAppendNoDefaultAll
module DatasetMethods
def select_append(*columns, &block)
cur_sel = @opts[:select]
return select(*columns, &block) if !cur_sel || cur_sel.empty?
select(*(cur_sel + columns), &block)
end
end
end
@cmrd-senya
cmrd-senya / readme.md
Last active April 3, 2018 23:27
Prosody telnet command to reload all modules

Prosody telnet command to reload all modules

> for _, mod in pairs(require"core.configmanager".get("*", "modules_enabled")) do require"core.modulemanager".reload("*", mod) end

Reference

Prosody telnet doc

diff --git a/app/serializers/export/others_data_serializer.rb b/app/serializers/export/others_data_serializer.rb
index 96a819c..8769545 100644
--- a/app/serializers/export/others_data_serializer.rb
+++ b/app/serializers/export/others_data_serializer.rb
@@ -11,24 +11,55 @@ module Export
# Authors of posts where we participated and authors are not in contacts
has_many :non_contact_authors, each_serializer: PersonMetadataSerializer
+ def initialize(user_id)
+ @user_id = user_id
diff --git a/lib/diaspora_federation/validators/photo_validator.rb b/lib/diaspora_federation/validators/photo_validator.rb
index 9c7bbb3..6c34914 100644
--- a/lib/diaspora_federation/validators/photo_validator.rb
+++ b/lib/diaspora_federation/validators/photo_validator.rb
@@ -1,7 +1,19 @@
module DiasporaFederation
module Validators
+ class Validator2 < Validation::Validator
+ def rules
+ super.reject do |field, _rules|
diff --git a/app/views/admins/_weekly_user_stats.haml b/app/views/admins/_weekly_user_stats.haml
index f61b04e..4ec4522 100644
--- a/app/views/admins/_weekly_user_stats.haml
+++ b/app/views/admins/_weekly_user_stats.haml
@@ -10,12 +10,12 @@
= form_tag("/admins/weekly_user_stats", method: "get", class: "form-inline week-selector row") do
.col-xs-9.center
= select_tag(:week,
- options_for_select(created_users_by_week, selected_week),
+ options_for_select(weeks, selected_week),
@cmrd-senya
cmrd-senya / cukes.diff
Created March 28, 2017 14:07
Make page&screen shot on cuke failure
diff --git a/features/support/env.rb b/features/support/env.rb
index c26248a..d461a01 100644
--- a/features/support/env.rb
+++ b/features/support/env.rb
@@ -76,3 +76,17 @@ Before do |scenario|
# Reset overridden settings
AppConfig.reset_dynamic!
end
+
+Cucumber::Formatter::LegacyApi::Ast::StepInvocation.class_eval do
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
gem "rails", github: "rails/rails"
Running "syncversion" task
Running "jshint:all" (jshint) task
>> 5 files lint free.
Running "jasmine:src" (jasmine) task
Testing jasmine specs via phantom
...............x.x....x.xx......x........x.....x.x..xx........................................................................................xx...........x.x............................................................................
jasmine.Fixtures load when fixture container does not exist should automatically create fixtures container and append it to DOM: failed
TypeError: 'undefined' is not a function (evaluating 'fixturesContainer().size()') in file:///home/senya/source/jasmine-jquery/spec/suites/jasmine-jquery-spec.js (line 106) (1)