Skip to content

Instantly share code, notes, and snippets.

View sseletskyy's full-sized avatar
🍊
FP mood

Sergiy Seletskyy sseletskyy

🍊
FP mood
View GitHub Profile
@sseletskyy
sseletskyy / Main.java
Created November 11, 2013 11:31
custom change to show splash screen
...
import com.cloudconsulting.Main.R;
public class Main extends CordovaActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.init();
@sseletskyy
sseletskyy / index.js
Created October 28, 2013 17:13
Fix for layout in iOS7
onDeviceReady: function() {
if(window.device && parseFloat(window.device.version) >= 7.0){
//$("footer").css("padding-bottom","20px");
document.body.style.marginTop = "20px";
// jQuery
$(".container").css("margin-top","20px");
// pure JS
document.getElementsByClassName('container')[0].setAttribute('style', 'margin-top: 20px');
}
app.receivedEvent('deviceready');
@sseletskyy
sseletskyy / Notes.md
Created October 9, 2013 12:21
Heroku related notes

#Toolbelt $ heroku login Enter email + password

$ heroku create

check git configuration $ git config -e

deploy the code from local branch "master"

# An abstract base class used to create simple serializers
# for ActiveRecord objects
class BaseSerializer
include Rails.application.routes.url_helpers
attr_reader :serialized_object
def initialize(serialized_object)
@serialized_object = serialized_object
end
@sseletskyy
sseletskyy / URL
Created July 2, 2013 07:18
Activerecord Postgres HStore
https://github.com/engageis/activerecord-postgres-hstore
@sseletskyy
sseletskyy / shell
Created July 1, 2013 15:01
Add support hstore for postgresql
psql -d template0 -c 'create extension hstore;'
@sseletskyy
sseletskyy / new_gist_file
Created July 1, 2013 10:28
Rails scaffolding types
Rails scaffolding types
These types are valid since Rails version 2:
string
text (long text, up to 64k, often used for text areas)
datetime
date
integer
binary
boolean
@sseletskyy
sseletskyy / new_gist_file
Created June 30, 2013 21:55
About gem Devise and how to use it
http://guides.railsgirls.com/devise/
@sseletskyy
sseletskyy / new_gist_file
Created June 30, 2013 21:54
More smart rspec
https://github.com/xaviershay/rspec-fire
@sseletskyy
sseletskyy / POSTGRES
Last active December 19, 2015 04:28
Install postgresql on Mountain Lion
Install postgresql on Mountain Lion
https://gist.github.com/demimismo/3359506
> brew install postgresql
> initdb /usr/local/var/postgres -E utf8
> mkdir -p ~/Library/LaunchAgents
> cp /usr/local/Cellar/postgresql/9.2.4/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
> launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
To start postgres manually