start new:
tmux
start new with session name:
tmux new -s myname
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'); |
... | |
import com.cloudconsulting.Main.R; | |
public class Main extends CordovaActivity | |
{ | |
@Override | |
public void onCreate(Bundle savedInstanceState) | |
{ | |
super.onCreate(savedInstanceState); | |
super.init(); |
--This is a handy PostreSQL script to fix sequences for all tables at once | |
SELECT 'SELECT SETVAL(' ||quote_literal(quote_ident(S.relname))|| ', MAX(' ||quote_ident(C.attname)|| ') ) FROM ' ||quote_ident(T.relname)|| ';' | |
FROM pg_class AS S, pg_depend AS D, pg_class AS T, pg_attribute AS C | |
WHERE S.relkind = 'S' | |
AND S.oid = D.objid | |
AND D.refobjid = T.oid | |
AND D.refobjid = C.attrelid | |
AND D.refobjsubid = C.attnum | |
ORDER BY S.relname; |
lvh.me - subdomain.lvh.me | |
>gem install html2slim | |
in case of using .rbenv don't forget to set path in bash_profile | |
>> PATH=${PATH}:~/.rbenv/versions/2.0.0-p353/bin/ | |
>for file in app/views/devise/**/*.erb; do erb2slim $file ${file%erb}slim && rm $file; done |
# Deploy and rollback script for Heroku on staging and/or production | |
# Modified from: https://gist.github.com/njvitto/362873 | |
namespace :deploy do | |
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU' | |
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU' | |
desc 'Deploy to Staging on Heroku' | |
task :staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
desc 'Deploy to Production on Heroku' |
#Deploy and rollback on Heroku in staging, production, dev and test environments | |
require 'tempfile' | |
# for capturing error in 'git push' | |
def capture_stderr | |
stderr = $stderr.dup | |
Tempfile.open 'stderr-redirect' do |temp| | |
$stderr.reopen temp.path, 'w+' | |
yield if block_given? |
describe ArticlesController do | |
describe "inactive article" do | |
let(:article) { double(:article, active?: false, id: 1) } | |
before(:each) do | |
allow(Article).to receive(:find) { article } | |
end |
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |