Skip to content

Instantly share code, notes, and snippets.

marzdgzmn

Block or report user

Report or block marzdgzmn

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 StudiesController.rb
def index
@studies = Study.search(params[:term])
respond_to do |format|
format.html
format.json { render json: @studies.map(&:title) }
end
end
View _form.html.erb
<%= form_with(model: study, url: yield(:url), local: true) do |f| %>
...
View loop.py
sample = { 'test': 'this is a test'}
for s in sample:
for msg in sample[s]: print "<li>%s</li" % msg
<li>t</li>
<li>h</li>
<li>i</li>
<li>s</li>
<li> </li>
<li>i</li>
View animalmixin
module AnimalMixin
class << self
def included(base)
base.extend ClassMethods
end
end
module ClassMethods
def inheritable_attributes(*args)
@inheritable_attributes ||= [:inheritable_attributes]
View redis
CustomerItem:123
CustomerItem:456
CustomerItem:789
CustomerItem:098
'CustomerItem:ids' '123, 456, 789, 098'
View podio_abstract_item.rb
class PodioAbstractItem < Podio::Item
def self.fetch_all_items(app_id)
Podio::Item.find_by_filter_values(app_id)
end
end
View config-initializers-01_podio.rb
Podio.setup(
api_url: 'https://api.podio.com',
api_key: Rails.application.config.podio_client_id,
api_secret: Rails.application.config.podio_client_secret
)
$podio = Podio.client.authenticate_with_credentials(
Rails.application.config.podio_username,
Rails.application.config.podio_password
)
View 01_podio.rb
Podio.setup(
api_url: 'https://api.podio.com',
api_key: Rails.application.config.podio_client_id,
api_secret: Rails.application.config.podio_client_secret
)
Podio.client.authenticate_with_credentials(
Rails.application.config.podio_username,
Rails.application.config.podio_password
)
View main.yml
- name: Set python interpreter to python 3 in Ubuntu
vars:
ansible_python_interpreter: '/usr/bin/python3'
when: (ansible_distribution == "Ubuntu" and ansible_distribution_major_version >= "14")
You can’t perform that action at this time.