Skip to content

Instantly share code, notes, and snippets.

View Zamyatin's full-sized avatar

Raj Singh Zamyatin

View GitHub Profile
@goyalankit
goyalankit / docker_0.md
Last active October 11, 2019 13:51
Docker Commands

Docker cheatsheet.

  • To get the list of commands:

      $ docker
    
  • To search for images in docker index:

      $ docker search tutorial
    
@endymion
endymion / contact.rb
Last active February 18, 2024 22:49
Example of integrating a Ruby on Rails app with Zapier using the REST hooks pattern. With support for triggering the REST hooks from Resque background jobs.
class Contact < ActiveRecord::Base
...
def after_create
if Hook.hooks_exist?('new_contact', self)
Resque.enqueue(Hook, self.class.name, self.id)
# To trigger directly without Resque: Hook.trigger('new_contact', self)
end
end
@stengland
stengland / search.rb
Created June 6, 2011 10:45
Paginated google custom search using HTTParty, Will Paginate and Ostruct
require 'httparty'
require 'will_paginate/collection'
require 'ostruct'
class GoogleCustomSearch
include HTTParty
base_uri 'https://www.googleapis.com/customsearch/v1'
format :json
default_params :cx => 'google-costom-searck-id', :key => 'google-api-key'