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
| #Signing AWS Requests By Using Signature Version 4 | |
| #http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html | |
| require 'uri' | |
| require 'openssl' | |
| require 'net/http' | |
| require 'cgi' | |
| method = 'GET' | |
| service = 'iam' |
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
| #!/bin/sh | |
| # this script sets some parameters to get a useable configuration | |
| # these changes are not persistent, you may want to include this in your autostart | |
| # 1 finger = left click, 2 finger = right click, 3 finger = middle click | |
| synclient TapButton2=3 | |
| synclient TapButton3=2 | |
| synclient ClickFinger2=3 | |
| synclient ClickFinger3=2 |
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
| inputs = %w[ | |
| CollectionSelectInput | |
| DateTimeInput | |
| FileInput | |
| GroupedCollectionSelectInput | |
| NumericInput | |
| PasswordInput | |
| RangeInput | |
| StringInput | |
| TextInput |
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
| #!/bin/bash | |
| HOMEMOUNT=$(mount | grep home | sed 's/ .*//' | sed 's#.*/##' ) | |
| if [[ ! "$(eval lsmod | grep "^flashcache")" ]]; then | |
| modprobe flashcache | |
| fi | |
| if [[ ! "$HOMEMOUNT" == "flashcache" ]]; then | |
| umount /home |
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
| # install and make run basic bootstrap date-picker functionality described here http://www.eyecon.ro/bootstrap-datepicker/ | |
| # app/assets/javascript/datepicker.js.coffee | |
| $(document).on 'pageChanged', -> | |
| # datepicker for simple_form & Ransack | |
| $(".custom_datepicker_selector").datepicker().on 'changeDate', (en) -> | |
| correct_format = en.date.getFullYear() + '-' + ('0' + (en.date.getMonth() + 1)).slice(-2) + '-' + ('0' + en.date.getDate()).slice(-2) # date format yyyy-mm-dd | |
| $(this).parent().find("input[type=hidden]").val(correct_format) |
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
| class Hash | |
| # options: | |
| # :exclude => [keys] - keys need to be symbols | |
| def to_ostruct_recursive(options = {}) | |
| convert_to_ostruct_recursive(self, options) | |
| end | |
| private | |
| def convert_to_ostruct_recursive(obj, options) | |
| result = obj |
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
| #!/usr/bin/env ruby | |
| # this tool is similar to "git bisect" one, but for specs. | |
| # it tries to find what spec from list of specs breaks execution of one specified spec. | |
| # | |
| # see more at http://zed.0xff.me/2010/01/28/rspec-bisect | |
| # | |
| # usage example: | |
| # ./rspec-bisect.rb spec/**/*_spec.rb spec/controllers/spaces/tickets_controller_spec.rb | |
| # [.] rspec runner: ./script/spec |
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
| # Doesn't work | |
| <p> | |
| <% case @request.author_hosted %> | |
| <% when "yes" %> | |
| The school <b>has</b> hosted an author before. | |
| <% when "no" %> | |
| The school <b>has not</b> hosted an author before. | |
| <% end %> | |
| </p> |