Skip to content

Instantly share code, notes, and snippets.

@amoose
amoose / gist:7621537
Last active December 29, 2015 05:19
Snippet to authenticate a user and query MyUSA profile.\
$(function() {
OAuth.initialize('public key');
$('.login').click(function(e) {
e.preventDefault();
OAuth.popup('myusa', function(error, result) {
$.ajax({
url: 'http://my.usa.gov/api/profile?access_token='+result.access_token,
headers: { 'Authorization': "Bearer "+result.access_token },
success: function(data) {
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000

Keybase proof

I hereby claim:

  • I am amoose on github.
  • I am amos (https://keybase.io/amos) on keybase.
  • I have a public key whose fingerprint is DD21 C744 B76D BDDA ADB6 8E57 DAFE B51B 8C67 F44F

To claim this, I am signing this object:

INSERT INTO dbpermissionrequests
SELECT username,
servername,
dbname,
accesstype,
Getdate() AS reqDate,
projectid,
'EXTENSION [999]: ',
'1' AS isActive
FROM dbpermissionrequests
@amoose
amoose / searchkick_ext.rb
Created August 4, 2014 14:58
ElasticSearch synonym tokenization with Searchkick gem
require 'searchkick'
module SearchkickSyn
def searchkick_index_options
# fetch index options
options = super
# inject Synonym filter for default index and searchkick search
options[:settings][:analysis][:analyzer][:default_index][:filter].push "synonym"
options[:settings][:analysis][:analyzer][:searchkick_search][:filter].push "synonym"
@amoose
amoose / import_articles.rake
Last active August 29, 2015 14:05
Imports Articles from fixtures
require 'yaml'
namespace 'import' do
desc "Imports sample Answers data from fixtures/articles.yml"
task :articles => :environment do
puts "Loading Answers data from spec/fixtures/articles.yml"
@questions = YAML::load_file('spec/fixtures/articles.yml')
➜ answers git:(feature/227_new-app-command-plus-lib-core) ✗ ./bin/answers MyApp
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/javascripts/application.js
create app/assets/stylesheets/application.css
Verifying that +astone is my blockchain ID. https://onename.com/astone
@amoose
amoose / shell_output.txt
Created October 29, 2016 16:54
Launching Fugacious on Heroku
➜ fugacious git:(master) ✗ bin/heroku
.----------------.
:s----------------s/
++ +s- :s/ ++ /s: /s/
++ sd: -dy` ++ sd/ +d+

Keybase proof

I hereby claim:

  • I am amoose on github.
  • I am amos (https://keybase.io/amos) on keybase.
  • I have a public key ASDmRiHhP-2pFmrNzmSZabw9-HVmo0EfDVtugku_m8g-Wgo

To claim this, I am signing this object: