NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
| def parse(self) | |
| =begin | |
| Method to parse the resource file for the terminal alias | |
| provided, and populate the gw array with the terminal information. | |
| Parameters | |
| ========== | |
| None | |
| Exceptions | |
| ========== | |
| zipfile.BadZipfile - in case resource file cannot be read |
| # Simple bijective function | |
| # Basically encodes any integer into a base(n) string, | |
| # where n is ALPHABET.length. | |
| # Based on pseudocode from http://stackoverflow.com/questions/742013/how-to-code-a-url-shortener/742047#742047 | |
| ALPHABET = | |
| "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split(//) | |
| # make your own alphabet using: | |
| # (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a).shuffle.join |
| html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}html{line-height:1}ol,ul{list-style:none}table{border-collapse:collapse;border-spacing:0}caption,th,td{text-align:left;font-weight:normal;vertical-align:middle}q,blockquote{quotes:none}q:before,q:after,blockquote:before,blockquote:after{content:"";content:none}a img{border:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}/*! HTML5 Boilerplate v4.3.0 | MIT License | http://h5bp.com/ */html,button,input,select,textarea{color:#222}html{font-size:1em;line-height:1.4}::-mo |
| =begin | |
| Help with Logic | |
| =end | |
| allRecords = Attendance.pluck(:date, :presence).map { |attendance, presence| [attendance.strftime('%B'), presence] } #=> [['November',true],['November',false],['November',true],['December', true], ['December', false], ['January',false], ['January',true]] | |
| monthFilter = allRecords.uniq.map { |month| [month[0]] } #=> ['November','November', 'November', 'December', 'December', 'January','January'] | |
| months = monthFilter.uniq #=> ['November','December','January'] | |
| # Expected To do the following: | |
| # To fetch all the records and count the number of true presence with false presence per month. Then get a percentage of true / total in each month |
| <html><head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <meta name="author" content="ostrich-dev"> | |
| <link href="http://fonts.googleapis.com/css?family=Roboto+Condensed:400,300" rel="stylesheet" type="text/css"> | |
| <link rel="author" href="http://ostrich-dev.com"> | |
| <link rel="shortcut icon" href="http://localhost:3000/favicon.ico"> | |
| <title>vitabiotics</title> | |
| <link data-turbolinks-track="true" href="/assets/application.css" media="all" rel="stylesheet"> |
| // Variables | |
| $hopbush: #c69; | |
| $bouquet: #b37399; | |
| $venus: #998099; | |
| $patina: #699; | |
| $nebula: #d2e1dd; | |
| $wine: #B21F1F; | |
| $dawn-pink: #f2ece4; | |
| $wafer: #e1d7d2; | |
| $skyblue: #9BC1F5; |
| $(document).ready -> | |
| $('[id^="edit_department"').on("ajax:success", (e, data, status, xhr) -> | |
| $(this).append "<p class='fr'>Updated Succesfully</p>" | |
| $(this).children('.fr').delay(2000).fadeOut() | |
| ).on "ajax:error", (e, data, status, error) -> | |
| $(this).append "<p class='fr'>Failed to update</p>" | |
| $('.content>.fr span:last-of-type>a').on "ajax:beforeSend", (xhr, settings) -> | |
| swal | |
| title: "Are you sure?" |
| <!-- Create --> | |
| <%= form_for @department do |f| %> | |
| <p> | |
| <%= f.label :name, 'Department Name' %> | |
| <%= f.text_field :name %> | |
| </p> | |
| <p> | |
| <%= f.label :parent %> | |
| <% department_array = @departments.all.map { |department| [department.name, department.name] } %> | |
| <%= f.select :parent, options_for_select([['no parent', '']] + department_array) %> |
| <section class="row-doubles"> | |
| <div> | |
| <div class="title">Add Department</div> | |
| <div class="content pad10"> | |
| <%= form_for @department, url: 'department_path' do |f| %> | |
| <p> | |
| <%= f.label :name, 'Department Name' %> | |
| <%= f.text_field :name %> | |
| </p> | |
| <p> |