Skip to content

Instantly share code, notes, and snippets.

View lbadura's full-sized avatar

Lukasz Badura lbadura

View GitHub Profile
@lbadura
lbadura / app_framework.rb
Created October 18, 2019 13:47
App Framework beta flags
# grid console payments production
# bundle exec rails c production
# paste and call :-)
app_framework = proc do |account_id|
BetaFeature.transaction do
features = %w[zendesk_app_market:sell_apps_public zendesk_app_market:sell_apps_private]
features.each do |feature|
BetaFeature.create!(account_id: account_id,
feature: feature, enabled: true, permanent: true)

Keybase proof

I hereby claim:

  • I am lbadura on github.
  • I am lbadura (https://keybase.io/lbadura) on keybase.
  • I have a public key ASAmPa0cgIq_3lg90vilK2AbNnLEei91sjtLoGjXdDfJHgo

To claim this, I am signing this object:

@lbadura
lbadura / install_elixir.md
Created May 5, 2016 13:02 — forked from rubencaro/install_elixir.md
Elixir installation guide

Elixir installation guide

Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.

The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir and you are good to go.

Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to a specific version, you will need to compile it yourself. Then kerl and exenv are your best friends.

@lbadura
lbadura / osx-setup.sh
Created February 8, 2016 10:39 — forked from somebox/osx-setup.sh
Set up an OSX machine from zero to awesome. Uses Homebrew (and cask, fonts, etc). Focused on Ruby/Rails development, includes rvm, xquartz, editor fonts, sublime text, and many tools.
#!/bin/bash
# A script to set up a new mac. Uses bash, homebrew, etc.
# Focused for ruby/rails development. Includes many utilities and apps:
# - homebrew, rvm, node
# - quicklook plugins, terminal fonts
# - browsers: chrome, firefox
# - dev: iterm2, sublime text, postgres, chrome devtools, etc.
# - team: slack, dropbox, google drive, skype, etc
select count(distinct ua.account_id) as wapa from user_activities ua
join paylogs p on p.account_id = ua.account_id
where ua.date >= '2015-03-02' and ua.date <= '2015-03-08'
and p.date >= '2015-03-02' and p.date <= '2015-03-08'
and p.status in('paying', 'expried');
select count(distinct ua.user_id) as wapu from user_activities ua
join paylogs p on p.account_id = ua.account_id
where ua.date >= '2015-03-02' and ua.date <= '2015-03-08'
and p.date >= '2015-03-02' and p.date <= '2015-03-08'
@lbadura
lbadura / keybase.md
Created February 26, 2015 09:34
keybase.md

Keybase proof

I hereby claim:

  • I am lbadura on github.
  • I am lbadura (https://keybase.io/lbadura) on keybase.
  • I have a public key whose fingerprint is 38F6 A438 98CD 83F3 0FB8 9428 3B0E 2C44 3CE4 04F9

To claim this, I am signing this object:

@lbadura
lbadura / gist:8556338
Created January 22, 2014 10:12
Render an authorization error if any of Backbone's syncs result with 401 response
originalSync = Backbone.sync
app = this
Backbone.sync = (method, model, opts) ->
dfd = $.Deferred()
if opts
dfd.then(opts.success, opts.error)
xhr = originalSync(method, model, _.omit(opts, 'success', 'error'))
xhr.done(dfd.resolve)
xhr.fail ->
woland(master)-{17:06}
$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [i686-linux]
woland(master)-{17:08}
$ script/server
/home/lukasz/.rvm/gems/ruby-1.8.7-p358@aaero/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:55: uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)
from /home/lukasz/.rvm/gems/ruby-1.8.7-p358@aaero/gems/activesupport-2.3.8/lib/active_support.rb:57:in `require'
from /home/lukasz/.rvm/gems/ruby-1.8.7-p358@aaero/gems/activesupport-2.3.8/lib/active_support.rb:57
from /home/lukasz/.rvm/gems/ruby-1.8.7-p358@aaero/gems/rails-2.3.8/lib/commands/server.rb:1:in `require'
from /home/lukasz/.rvm/gems/ruby-1.8.7-p358@aaero/gems/rails-2.3.8/lib/commands/server.rb:1
@lbadura
lbadura / rbenv-install-system-wide.sh
Created May 21, 2012 11:13 — forked from devsigner/rbenv-install-system-wide.sh
rbenv install ruby 1.9.3-p125 on Debian 6 Squeeze
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential git-core curl libssl-dev \
libreadline5 libreadline5-dev \
zlib1g zlib1g-dev \
libmysqlclient-dev \
libcurl4-openssl-dev \
libxslt-dev libxml2-dev
# on loading the page
:3000/:19GET http://localhost:3000/assets/ads/ad.js?body=1
:3000/:19GET http://localhost:3000/assets/ads/index.js?body=1
:3000/:19GET http://localhost:3000/assets/views/ads/ads_index.js?body=1
# after clicking find it
jquery.js:8241XHR finished loading: "http://localhost:3000/api/listings?what=&where=Seattle%2C+WA&limit=10".
search_index.js:157Uncaught TypeError: undefined is not a function
jquery.js:8241XHR finished loading: "http://localhost:3000/api/ads?what=&where=Seattle%2C+WA&limit=6".
search_index.js:157Uncaught TypeError: undefined is not a function