Skip to content

Instantly share code, notes, and snippets.

View pradhumnsharma's full-sized avatar

pradhumnsharma

View GitHub Profile
@pradhumnsharma
pradhumnsharma / Ubuntu commands
Created March 22, 2018 04:04
Important linux commands
Recently viewed/accessed files on ubuntu system:-
awk -F"file://|\" " '/file:\/\// {print $2}' ~/.local/share/recently-used.xbel
@pradhumnsharma
pradhumnsharma / Shopify app
Created March 30, 2018 07:14
How to open shopify app in app page on store
<script type="text/javascript">
ShopifyApp.init({
apiKey: '<?php echo APP_API_KEY; ?>',
shopOrigin: 'https://<?php echo $_SESSION['shop']; ?>',
forceRedirect: true
});
</script>
@pradhumnsharma
pradhumnsharma / Rails command
Last active March 31, 2018 01:37
How to deploy rails environment in aws cloud9 ?
Since new EC2 instance already contains most of the tools required for Ruby on Rails 5.1 development. We have to run the command given below to setup environment.
rails new . -T
<form action="/search" method="get" class="search-bar" role="search" style="text-align:left;">
<button type="submit" class="btn" style="position:absolute; margin-left: 8px; margin-top: 6px;">
<i class="fa fa-search"></i>
</button>
<input type="search" placeholder="Search articles" name="q" value="{{ search.terms | escape }}" style="height:32px; padding-left:25px; margin-top:20px; width:100%; border-radius:40px;">
</form>
<div class="blog-newsletter">
<img src="{{ 'msg_medium_blue.png' | asset_img_url: 'medium' }}" alt="No image">
<h5>Join thousands of women who already have gotten stronger.</h5>
@pradhumnsharma
pradhumnsharma / Rails Installation commands
Created April 19, 2018 09:59
How to install rails on localhost?
Step 1:- Login as super user using command
=> sudo su
Step 2:- The ROR installation begins with installing RVM on the server. It is important to install the latest version of RVM on the system, this requires an installation of the CURL command. The following command does the job.
=> apt-get install curl
Step 3:- To proceed with the RVM installation, import the rvm.io public key in the server system using this command.
=> curl -#LO https://rvm.io/mpapis.asc
=> gpg --import mpapis.asc
@pradhumnsharma
pradhumnsharma / npm and node-gyp errors
Created May 10, 2018 05:16
Node and npm related issues
When installing node and npm we may get error of "npm update failed" or "node-gyp/bin/node-gyp not found".
To overcome these errors we have to remove some files before uninstalling node. These are the instructions
a). sudo rm -rf /usr/local/bin/node-gyp
b). sudo rm -rf /usr/local/bin/npm
c). sudo rm -rf /usr/local/bin/npx
d). sudo rm -rf /usr/local/lib/node_modules/
and cleaning node files in home directory, for precaution:
Ques 1: Create a function named `customObjFlatten` which will take an pure nested object and return single level key value pair such as
INPUT
{
a: 12,
b: 15,
c: {
d: 31,
e: {
f:51,
g: {