This file contains hidden or 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 file contains hidden or 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
| arr = $(".trow").not(".free").not(".header").not("[id^=sidebar-row]"); | |
| new_arr = new Array; | |
| $.each(arr, function(_, e) { | |
| var $project = $(e).find(".tcell.project"); | |
| var employee_id = $project.data("employee-id"); | |
| var ratio = $project.data("ratio"); | |
| var class_name = $(e).attr("class"); | |
| var index = null; |
This file contains hidden or 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
| $(document).on('change', '#statistics .table input', function(e) { | |
| // var $target = e.target | |
| // if ($target.name === "value" && !$.isNumeric($target.value)) { | |
| // alert("pls, enter number"); | |
| // } | |
| // function SaveDataToLocalStorage(hash, project_id) { | |
| // var data = localStorage.getItem('statistic_data'); | |
| // data = data === null ? [] : JSON.parse(data); |
This file contains hidden or 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
| Rails.redis.get(key) | |
| Rails.redis.set(key, value) | |
| Rails.redis.expire(key, 1.hour) | |
| Rails.redis.del(key) | |
| Rails.redis.sadd(set_name, value) | |
| Rails.redis.srem(set_name, key) | |
| Rails.redis.sismember(set_name, value) # boolean test to see if val exists |
This file contains hidden or 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
| namespace :db do | |
| desc "Remaking data" | |
| task remake_data: :environment do | |
| Rake::Task["db:migrate:reset"].invoke | |
| puts "Creating manager" | |
| FactoryGirl.create :user | |
| puts "Creating ranks 1 to 10" | |
| FactoryGirl.create_list :rank, 10 |
This file contains hidden or 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
| To connect: | |
| mysql -uroot | |
| To have launchd start mysql at login: | |
| ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents | |
| Then to load mysql now: | |
| launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist | |
| Or, if you don't want/need launchctl, you can just run: | |
| mysql.server start |
This file contains hidden or 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
| # Rails command shortcut | |
| alias rs="rails s" | |
| alias rc="rails c" | |
| alias cs="cap sync" | |
| # Git command | |
| alias gcod="git checkout -f && git checkout develop" | |
| alias gfp="git fetch pullrequest" | |
| alias grc="git rm -r --cached ." |
This file contains hidden or 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 class="filter" id="filter-position"> | |
| <div class="order text-left"> | |
| <p> | |
| <button class="position-order" value="asc"> | |
| <%= t("salaries.text.order.sort_asc").html_safe %> | |
| </button> | |
| </p> | |
| <p> | |
| <button class="position-order" value="desc"> | |
| <%= t("salaries.text.order.sort_desc").html_safe %> |
This file contains hidden or 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
| <li> | |
| <div class="line-item"> | |
| <%= f.hidden_field :period_id %> | |
| <%= f.hidden_field :employee_id %> | |
| <%= f.hidden_field :evaluation_type %> | |
| <span class="evaluation-type"> | |
| <%= f.label :evaluation_type, f.object.evaluation_type, | |
| class: "text-capitalize" %> | |
| </span> | |
| <span><%= f.number_field :knowledge, value: format_integer(f.object.knowledge, f.object),min: 0, |
This file contains hidden or 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
| <%= form_for @project, html: {class: "project-form", id: "new_project"} do |f| %> | |
| <%= render "shared/errors_messages", object: @project %> | |
| <div class="row"> | |
| <div class="form-group col-md-4"> | |
| <%= f.label :name %> | |
| <%= f.text_field :name, class: "form-control", required: true %> | |
| </div> | |
| </div> | |
| <div class="row"> |