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 to enable WS support. Credits: # https://gist.github.com/Bubelbub/0a942a0d51a3d329897d | |
# THIS WORKS! for running the example 5.0.0.beta1 chat app on a single instance Elastic beanstalk AWS instance | |
files: | |
"/etc/nginx/conf.d/websockets.conf" : | |
content: | | |
upstream backend { | |
server unix:///var/run/puma/my_app.sock; | |
} |
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
<script> | |
// .vue files typically have 3 section | |
// 1.template - markup, 2.script - js, 3.style - css | |
// we are importing the csrf component it has two hidden input fields | |
// for csrf token and utf encoding | |
// creating a component helps us reuse it in multiple forms | |
import CSRF from 'components/shared/csrf.vue'; | |
export default { |
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
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 |
OlderNewer