Skip to content

Instantly share code, notes, and snippets.

View kovacs's full-sized avatar

Michael Kovacs kovacs

  • San Francisco, CA
  • X @mk
View GitHub Profile
@kovacs
kovacs / ssl.md
Created March 6, 2017 06:56
Gem SSL problem/solution

I wasn't able to bundle install on a new rails app (https://github.com/RailsApps/rails-stripe-membership-saas) because of a cert update on rubygems.org

Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)

The fix for me was the following - http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages

But, I had to make sure to install that update from within the directory of the new app to make sure it applied to the gemset there because it wasn't picking up the update that I'd made to my system rubygems. Once I did that I was good to go.

@kovacs
kovacs / firstround.js
Last active October 22, 2015 17:43
Don't tease me bro
var el = document.getElementsByClassName("TextBlock"); for(var e = 0; e < el.length; e++) { el[e].style.cssText = ""; }; el = document.getElementsByClassName("bcx_callout"); for(var e = 0; e < el.length; e++) {el[e].style.cssText = "display: none;"};
@kovacs
kovacs / gist:1dbc7cafd405253110b4
Created February 26, 2015 20:50
Bulk rename/move files
Simple reminder for myself next time I've downloaded a bunch of files with the wrong, or no extension...
Given the following wav files in a dir:
50-13-0
50-13-1
50-13-2
50-13-3
50-13-4
50-13-5
50-13-6
### Keybase proof
I hereby claim:
* I am kovacs on github.
* I am kovacs (https://keybase.io/kovacs) on keybase.
* I have a public key whose fingerprint is 4A8A A46E 7F5D FB64 4D34 EF6C C657 8ED3 A480 D76D
To claim this, I am signing this object:
Exception in thread "main" java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.deser.BeanDeserializerBuilder.build()Lcom/fasterxml/jackson/databind/JsonDeserializer;
at com.fasterxml.jackson.module.afterburner.deser.CustomDeserializerBuilder.build(CustomDeserializerBuilder.java:17)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.buildBeanDeserializer(BeanDeserializerFactory.java:289)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:171)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:388)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244)
at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:143)
at com.fasterxml.jackson.databind.Deserializati
** [fightdogcancer.com :: out] Initialized empty Git repository in /opt/apps/dogstories/releases/20091028053929/vendor/plugins/attachment_fu/.git/
** [fightdogcancer.com :: err] ssh_exchange_identification: Connection closed by remote host
** [fightdogcancer.com :: err] fatal: The remote end hung up unexpectedly
** [fightdogcancer.com :: err] Unable to checkout 'fa08cb03914b02b66853b4615cd3eca768291ca7' in submodule path 'vendor/plugins/attachment_fu'
// get checkbox value in jquery
$("#checkbox_id").is(':checked')
One other cause is your :dependent callbacks.
class Blog < AR::Base
has_many :posts, :dependent => :destroy
end
This will iterate through every post and call #destroy on it. Use :delete_all if you want to just issue a single delete query. HOWEVER, this won't hit your destroy callbacks on Post.
class Blog < AR::Base
has_many :posts
require 'rubygems'
require 'sinatra'
require 'redis'
# To use, simply start your Redis server and boot this
# example app with:
# ruby example_note_keeping_app.rb
#
# Point your browser to http://localhost:4567 and enjoy!
#
PGError: ERROR: permission denied: "RI_ConstraintTrigger_25540" is a system trigger
: ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "agent_invites" ENABLE TRIGGER ALL;ALTER TABLE "beta_invite_codes" ENABLE TRIGGER ALL;ALTER TABLE "beta_invites" ENABLE TRIGGER ALL;ALTER TABLE "beta_invites_channels" ENABLE TRIGGER ALL;ALTER TABLE "channel_invites" ENABLE TRIGGER ALL;ALTER TABLE "channel_relationships" ENABLE TRIGGER ALL;ALTER TABLE "on_duty_messages" ENABLE TRIGGER ALL;ALTER TABLE "queued_messages" ENABLE TRIGGER ALL;ALTER TABLE "queued_messages_failures" ENABLE TRIGGER ALL;ALTER TABLE "robot_config" ENABLE TRIGGER ALL;ALTER TABLE "robot_log_entries" ENABLE TRIGGER ALL;ALTER TABLE "robot_queue_entries" ENABLE TRIGGER ALL;ALTER TABLE "robot_stats_log" ENABLE TRIGGER ALL;ALTER TABLE "service_notes" ENABLE TRIGGER ALL;ALTER TABLE "twitterer_notes" ENABLE TRIGGER ALL;ALTER TABLE "twitterers" ENABLE TRIGGER ALL;ALTER TABLE "updates" ENABLE TRIGGER ALL;ALTER TABLE "channels" ENABLE TRIGGER ALL;ALTE