- Where to Add Snippets
- How to find out the language selector (scope)
- How to format a snippit
In Atom, you can add snippets by going to the Atom menu and going to Snippets...
| #!/bin/sh | |
| BRANCH=$(git branch | grep \* | cut -d ' ' -f2) | |
| REF=$(git merge-base master $BRANCH) | |
| DIFFS=$(git diff --diff-filter AM --name-only --relative $REF) | |
| if [ "$DIFFS" != "" ] | |
| then | |
| echo "Checking for rubocop offenses..." | |
| OFFENSES=$(rubocop $(echo "$DIFFS")) | |
| if [ "$(echo $OFFENSES | grep 'no offenses')" == "" ] | |
| then |
| class Integer | |
| def luhn_sum | |
| num = self.to_s.chars | |
| sum = 0 | |
| num.reverse.each_with_index do |n,i| | |
| n = n.to_i | |
| n *= 2 if i % 2 == 1 |
| def addition_function # declare this outside of the case and loop so we can call it repeatedly | |
| puts "Which numbers would you like to add?" | |
| n1 = gets.chomp.to_i | |
| n2 = gets.chomp.to_i | |
| answer = n1 + n2 | |
| puts "The sum is: #{answer}" | |
| end | |
| def show_menu | |
| puts "Calculator" |
| // <input type="range" id="size" min="3" max="10" value="3"> | |
| // <div class="board"> | |
| // </div> | |
| let p = 0; | |
| const s = []; | |
| let size = +$('#size').val() //set size to default | |
| const makeBoard = function() { | |
| size = +$('#size').val() //get size from input |
| $(document).ready(function() { | |
| const balance = { | |
| savings: 0, | |
| checking: 0 | |
| }; | |
| //CHANGING COLOR ON $0... | |
| const zeroBalance = function() { | |
| if (balance['savings'] === 0) { |
| ################################################################################ | |
| # GLaDOS SHELL Welcome Messages! | |
| ################################################################################ | |
| # Colours Variables | |
| RESET="\033[0m" | |
| BOLD="\033[1m\e[38;5;214m" | |
| ORANGE="\e[38;5;208m" | |
| # FUN GLaDOS QUOTES!!! | |
| echo "${BOLD}Initialising GLaDOS...${RESET}" |
| // sum shopping cart items js | |
| // shopping cart object | |
| const cartForParty = { | |
| banana: "1.25", | |
| handkerchief: ".99", | |
| Tshirt: "25.01", | |
| apple: "0.60", | |
| nalgene: "10.34", | |
| proteinShake: "22.36" |
| //create empty array of bank accounts | |
| let bankAccounts = [] | |
| // function to create a new account | |
| const addAccount = function( name, amount ) { | |
| // create new account object | |
| let newAccount = { | |
| accountName: name, | |
| balance: amount |
| ################################################################################ | |
| # AD PROFILE PICTURE EXTRACTOR # | |
| ################################################################################ | |
| # THIS SCRIPT WILL GET THE thumbnailPhoto ATTRIBUTE FROM ACTIVE DIRECTORY USER # | |
| # AND SAVE TO JPEG # | |
| # # | |
| # AUTHOR: TIM CALDWELL # | |
| # DATE: 21/02/2014 # | |
| ################################################################################ | |
| param( |