Skip to content

Instantly share code, notes, and snippets.

View jtomaszewski's full-sized avatar

Jacek Tomaszewski jtomaszewski

View GitHub Profile
@jtomaszewski
jtomaszewski / 015-disable_bitcode_on_ios.sh
Last active January 5, 2016 07:59
hooks/after_platform_add/015-disable_bitcode_on_ios.sh
#!/bin/sh
# Exit, if there's no ios here.
[[ $CORDOVA_PLATFORMS == *"ios"* ]] || exit 0
# This is needed until https://github.com/Wizcorp/phonegap-facebook-plugin/issues/1116 gets fixed.
XCCONFIG_FILE="platforms/ios/cordova/build.xcconfig"
if ! cat $XCCONFIG_FILE | grep -q "ENABLE_BITCODE"; then
echo "\nENABLE_BITCODE = NO" >> $XCCONFIG_FILE
fi
@jtomaszewski
jtomaszewski / god.rb
Created December 25, 2013 01:24
Watch websocket_rails server with God
RAILS_ROOT = File.expand_path('../', File.dirname(__FILE__))
RAILS_ENV = ENV['RAILS_ENV'] || 'production'
God.watch do |w|
w.name = "websocket_rails"
w.start = "cd #{RAILS_ROOT} && bundle exec rake websocket_rails:start_server"
w.stop = "cd #{RAILS_ROOT} && bundle exec rake websocket_rails:stop_server"
w.pid_file = "#{RAILS_ROOT}/tmp/pids/websocket_rails.pid"
@jtomaszewski
jtomaszewski / vps_configuration.md
Last active December 29, 2015 06:39
Example, quick VPS configuration (debian 7 wheeze). Submit changes or fork it and we'll make it better! =)

ssh

  1. create your own user
adduser johndoe # root@vps

# now, relogin onto johndoe 
mkdir .ssh

# copy ssh key from your local machine to johndoe's account
@jtomaszewski
jtomaszewski / ionicVerticalSlideBox.js
Created November 5, 2014 10:45
A cloned `ionic.views.Slider` and `slideBox` directive to `ionic.views.verticalSlider` and `verticalSlideBox`: it was done just by renaming "x, y, left, right" strings into "y, x, top, bottom". It works correctly ;)
var IonicModule = angular.module('ionic'),
extend = angular.extend,
forEach = angular.forEach,
isDefined = angular.isDefined,
isString = angular.isString,
jqLite = angular.element;
/**
* @ngdoc directive
* @name ionVerticalSlideBox
@jtomaszewski
jtomaszewski / deploy.rb
Last active October 21, 2015 17:22
Eye configuration for unicorn && sidekiq
# ...
namespace :deploy do
desc 'Restart application'
task :restart => ["eye:reload", "eye:restart"]
after :published, :restart
end
@jtomaszewski
jtomaszewski / ng_http_transform_request_to_form_data.coffee
Created April 17, 2014 14:45
Method that transforms data[Hash] into FormData object.
angular.module 'gulliver'
# This will transform data[Hash] into FormData object.
# Supports nested objects and FileList (file input's value).
#
# Note: This won't work on browsers not supporting FormData and FileList (f.e. IE 8-9).
.service 'httpTransformRequestToFormData', ->
(data) ->
return data unless data