Skip to content

Instantly share code, notes, and snippets.

View spkprav's full-sized avatar
🧑‍🚀
spkprav@github:(me) $ git merge multiverse

Praveen Kumar S spkprav

🧑‍🚀
spkprav@github:(me) $ git merge multiverse
View GitHub Profile
<?php /* Template Name: Products */ ?>
<?php get_header()?>
<script type="text/javascript">
<?php
$pod = pods('product');
$params = array(
"where" => "d.product_price"
);
$pod->find($params,$limit=-1);
@spkprav
spkprav / dropbox
Last active May 10, 2016 12:43 — forked from lmammino/dropbox
Run dropbox CLI as service
#/etc/init.d/dropbox
start() {
echo "Starting dropbox..."
start-stop-daemon -b -o -c dropbox -S -x /dropbox/.dropbox-dist/dropboxd
}
stop() {
echo "Stopping dropbox..."
start-stop-daemon -o -c dropbox -K -x /dropbox/.dropbox-dist/dropboxd
@spkprav
spkprav / web-fonts-asset-pipeline.md
Created April 1, 2016 10:56 — forked from anotheruiguy/web-fonts-asset-pipeline.md
Custom Web Fonts and the Rails Asset Pipeline

Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.

Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.

As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.

The recommended way

Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.

@spkprav
spkprav / ruby_setup.md
Created April 1, 2016 07:44 — forked from julionc/ruby_setup.md
Deploy Ruby On Rails on Ubuntu 14.04

Deploy Ruby On Rails on Ubuntu 14.04

Server: Nginx with Phusion Passenger

Ruby Version: 2.1.3

User System: deploy

User System

@spkprav
spkprav / install_passenger_nginx_digital_ocean.sh
Last active December 4, 2015 16:47 — forked from sathishmanohar/install_passenger_nginx_digital_ocean.sh
Steps to setup and install passenger nginx and rails on digital ocean
# Login as root
ssh root@domain
# Create deploy user
adduser <username> #Adds User with username given. Enter Password when Prompted. Other Details are Optional
# Add user to sudo group
usermod -g <groupname> <username>
# Add .ssh/authorized_keys for deploy user
@spkprav
spkprav / db.rake
Last active August 29, 2015 14:22 — forked from hopsoft/db.rake
# lib/tasks/db.rake
namespace :db do
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
with_config do |app, host, db, user|
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump"
end
puts cmd