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 bash | |
| # checks if branch has something pending | |
| function files() { | |
| hashid=$(parse_git_hash) | |
| hashid=${hashid#@} | |
| git diff-tree --no-commit-id --name-only -r $hashid | |
| } |
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
| Version: 2016.3.2 | |
| Select License server and paste the following | |
| http://idea.imsxm.com/ |
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
| <?php | |
| public function getLeadingZeros($begin, $end){ | |
| $range = []; | |
| foreach(range($begin, $end) as $key=>$value){ | |
| $digit = str_pad($value, 2, "0", STR_PAD_LEFT); | |
| $range[$digit] = $digit; | |
| } | |
| return $range; | |
| } |
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
| git commit [some files] | |
| Or if you are sure that you have a clean staging area you can | |
| git add [some files] # add [some files] to staging area | |
| git add [some more files] # add [some more files] to staging area | |
| git commit # commit [some files] and [some more files] | |
| git commit file1 file2 file5 -m "commit message" | |
| If you want to make that commit available on both branches you do | |
| git stash # remove all changes from HEAD and save them somewhere else |
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
| //Firefox | |
| jQuery('#wrapper').bind('DOMMouseScroll', function(e){ | |
| if(e.originalEvent.detail > 0) { | |
| //scroll down | |
| console.log('Down'); | |
| }else { | |
| //scroll up | |
| console.log('Up'); | |
| } |
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
| Email regex | |
| /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{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
| function addMinutes(time, minsToAdd) { | |
| function z(n){ | |
| return (n<10? '0':'') + n; | |
| } | |
| var bits = time.split(':'); | |
| var mins = bits[0]*60 + (+bits[1]) + (+minsToAdd); | |
| return z(mins%(24*60)/60 | 0) + ':' + z(mins%60); | |
| } |
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
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>Manage Contact Types</title> | |
| <link rel="stylesheet" href="...."> | |
| <meta name="csrf-token" content="<?php echo csrf_token() ?>"/> | |
| </head> | |
| $(function () { |
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
| $('#file-input').change(function(e){ | |
| var files = e.target.files; | |
| for (var i = 0, f; f = files[i]; i++) { | |
| if(f.type){ | |
| var image_types = ['image/png', 'image/jpg', 'image/jpeg']; | |
| if((f.type && image_types.indexOf(f.type) < 0)) { | |
| alert('Invalid file selected. Supported formats are jpeg and png.'); | |
| $(this).val(''); | |
| } else { | |
| readURL(f, $('.image-preview')); |
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
| %a - abbreviated weekday name | |
| %A - full weekday name | |
| %b - abbreviated month name | |
| %B - full month name | |
| %c - preferred date and time representation | |
| %C - century number (the year divided by 100, range 00 to 99) | |
| %d - day of the month (01 to 31) | |
| %D - same as %m/%d/%y | |
| %e - day of the month (1 to 31) | |
| %g - like %G, but without the century |