Skip to content

Instantly share code, notes, and snippets.

💭
hacking away on notebook.ai

Andrew Brown drusepth

💭
hacking away on notebook.ai
Block or report user

Report or block drusepth

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View lol2.rb
@linked_entities = []
Rails.application.config.content_types[:all].each do |content_type|
@linked_entities += @document.document_entities
.where(entity_type: content_type.name)
.where.not(entity_id: nil)
.includes(:entity, entity: [:universe, :user])
.includes(entity: Rails.application.config.content_relations.fetch(content_type.name, []).map do |relation, data|
content_type.instance_methods.include?(data[:with]) ? data[:with] : nil
end.compact)
end
View lol.rb
@linked_entities = @document.document_entities
.where.not(entity_id: nil)
.includes(:entity)
.includes(entity: [:universe, :user, *relations_for_class(-> entity.entity_type)])
.order('entity_type asc')
View wtfruby.rb
Rails.application.config.content_types[:premium].each do |content_type|
authorizer_class_name = "#{content_type.name}ContentAuthorizer"
Object.const_set(authorizer_class_name, Class.new(ContentAuthorizer) do
def self.createable_by?(user)
return false if ENV.fetch('CONTENT_BLACKLIST')&.split(',')&.include?(user.email)
[
PermissionService.billing_plan_allows_extended_content?(user: user),
PermissionService.user_can_collaborate_in_universe_that_allows_extended_content?(user: user),
PermissionService.user_has_active_promotion_for_this_content_type(user: user, content_type: content_type.name)
View conspiracies.out
Do you believe the U.S. government is a secret military agency working with aliens?
Does the sun still shine in the south-eastern United States? Is it possible that the sun was actually a global warming event and that only the northern hemisphere is suffering the effects?
Can we all just agree that if global warming doesn't stop, the only ones who will really suffer are the 99%. So why can't we all just agree that it is all right to leave global warming to it?
If there is alien life on other planets could it be beneficial or just a threat to mankind?
Is the FBI conducting an ongoing search for aliens?
Do the alien abductees you have seen on Earth from other planets also exist on other dimensions?
Why is the government looking into aliens?
How does the US military get involved in extraterrestrial activity?
Is it possible the CIA is trying to help aliens with a space program?
What is the best alien abduction story?
View conspiracy-topics.in
Chemtrails
Conspiracy Theories
Illuminati
Secret Societies
National Security Agency
Mass Surveillance
New World Order (NWO)
PRISM (NSA surveillance program)
Flat Earth Research
Flat Earth Theory
View writing-questions.txt
When writing a short story what should I do first?
Can you write a short science fiction story that you think most people will enjoy?
How would you write a story where an intelligent person is deliberately sabotaging the most interesting ideas in the audience's head?
What are the best tips for writing an interesting short story?
What inspired you to write short stories?
What are the basics of writing short stories?
What are the best online courses to teach aspiring writers how to create and write short stories?
What does Edgar Allan Poe's short stories tell us about the dangers that lie in the dark?
Can you give a short motivational poem to read to a little girl?
How can I write a poem for somebody dying soon?
View tabbing.rb
<%=
link_to send(
"page_tag_#{content_type.pluralize}_path",
slug: PageTagService.slug_for(page_tag.tag)
), class: "#{Character.color}-text" do
%>
<i class="material-icons">loyalty</i>
<small class="grey-text">tagged</small>
<%= page_tag.tag %>
<% end %>
View unicorn
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the unicorn app server
# Description: starts unicorn using start-stop-daemon
### END INIT INFO
View sites-available slash default
upstream app {
# Path to Unicorn SOCK file, as defined previously
server unix:/home/ubuntu/listpump/shared/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 0.0.0.0;
server_name localhost;
root /home/ubuntu/listpump/public;
try_files $uri/index.html $uri @app;
location @app {
View lol.rb
def self.combined_average_grade_level corpus
scores = [
automated_readability_index(corpus),
coleman_liau_index(corpus),
FleschKincaidService.grade_level(corpus),
forcast_grade_level(corpus),
gunning_fog_index(corpus),
smog_grade(corpus)
]
scores.reject! &:nan?
You can’t perform that action at this time.