This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype HTML> | |
<meta charset = 'utf-8'> | |
<html> | |
<head> | |
<link rel='stylesheet' href='//cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.css'> | |
<script src='//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js' type='text/javascript'></script> | |
<script src='//d3js.org/d3.v3.min.js' type='text/javascript'></script> | |
<script src='//cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.js' type='text/javascript'></script> | |
<script src='//nvd3.org/assets/lib/fisheye.js' type='text/javascript'></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype HTML> | |
<meta charset = 'utf-8'> | |
<html> | |
<head> | |
<script src='//code.jquery.com/jquery-1.9.1.min.js' type='text/javascript'></script> | |
<script src='//code.highcharts.com/highcharts.js' type='text/javascript'></script> | |
<script src='//code.highcharts.com/highcharts-more.js' type='text/javascript'></script> | |
<script src='//code.highcharts.com/modules/exporting.js' type='text/javascript'></script> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Program to find count of words in a given grid | |
Rule : Do not reuse a cell | |
Rule : Do not cross over | |
Rule : can travel to adjecent 8 cells | |
input : 'word' | |
n x m | |
r a y x d | |
p e t r o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!--This is the main frame layout in which I set hight, background and align it to the bottom--> | |
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/toolbar" | |
android:layout_width="match_parent" | |
android:layout_height="80dp" | |
android:layout_alignParentBottom="true" | |
android:layout_gravity="bottom" | |
android:background="@color/colorPrimaryDark" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- this is the same id we reffered in the vue file --> | |
<!-- for consisteny, I also follow a convention in this --> | |
<!-- {folder-paths}-{action}-view --> | |
<div id="devise-registrations-new-view"> | |
<!-- we talked about passing the validation error to vue --> | |
<!-- here is how easy it is to do this --> | |
<devise-registrations-new-view :errors="<%= resource.errors.full_messages %>"> | |
</devise-registrations-new-view> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue/dist/vue.esm'; | |
// I am using elements UI for the UI components | |
// you can find them here, but you can do without them | |
// http://element.eleme.io/#/en-US | |
import ElementUI from 'element-ui'; | |
// This the .vue file that we will create next | |
import DeviseRegistrationsNewView from 'views/devise/registrations/new.vue'; | |
// It tells vue to register ElementUI, so that we can use it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Description: | |
Create Vue files corresponding to the Rails views | |
Example: | |
rails generate vue [namespace]/[controller]/action | |
This will create: | |
app/javascript/packs/[namespace]/[controller]/action.js | |
app/javascript/views/[namespace]/[controller]/action.vue | |
app/views/[namespace]/[controller]/action.html.erb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the generator extends from NamedBase base class which makes sure | |
# alleast a name must be provided to the generator | |
class VueGenerator < Rails::Generators::NamedBase | |
source_root File.expand_path('../templates', __FILE__) | |
# if you remember all the public methods will be executed in the defined order | |
# this method will create a JavaScript file using the javascript.erb template | |
# in the location defined as the next params | |
# we will look into the content of the templates next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="<%= vue_component_kebab_name %>"> | |
<%= vue_component_snippet %> | |
</div> | |
<%= stylesheet_pack_tag_snippet %> | |
<%= javascript_pack_tag_snippet %> |
OlderNewer