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
| alias gs='git status' | |
| alias gc='git checkout' | |
| alias gl='git pull origin $(git rev-parse --abbrev-ref HEAD)' | |
| alias gp='git push origin $(git rev-parse --abbrev-ref HEAD)' | |
| git checkout - => Switch to previous branch. | |
| alias pb='git checkout -' | |
| git branch -m {{new_branch_name}} => Rename branch. | |
| git reset --hard HEAD => Cancel Staged changes (before committing) |
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
| _.chain(rawUrl) | |
| .replace('?', '') // a=b454&c=dhjjh&f=g6hksdfjlksd | |
| .split('&') // ["a=b454","c=dhjjh","f=g6hksdfjlksd"] | |
| .map(_.partial(_.split, _, '=', 2)) // [["a","b454"],["c","dhjjh"],["f","g6hksdfjlksd"]] | |
| .fromPairs() // {"a":"b454","c":"dhjjh","f":"g6hksdfjlksd"} | |
| .value() |
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
| $state.transitionTo(to, {'tab': 'comments'}, { location: true, inherit: true, notify: false, reload: false}); |
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 lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title></title> | |
| <style> | |
| * { |
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
| render.page ? (render.page - 1 < 0 ? 0 : render.page - 1) : 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
| document.querySelector("input[type='password']").parentElement.parentElement.querySelector("input[type='text']").value; | |
| document.querySelector("input[type='password']").parentElement.parentElement.querySelector("input[type='email']").value; |
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
| // Set counter | |
| $i = 0; | |
| // Increase counter within the scope | |
| // of the function | |
| $closure = function () use ($i){ $i++; }; | |
| // Run the function | |
| $closure(); | |
| // The global count hasn’t changed | |
| echo $i; // Returns 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
| //http://plnkr.co/edit/ZZOjr2?p=preview | |
| //https://daveceddia.com/sharing-data-between-controllers-best-practice-use-a-service/ | |
| var app = angular.module('plunker', []); | |
| app.controller('MainCtrl', function($scope, dataService) { | |
| $scope.name = 'World'; | |
| //set up the items. | |
| angular.copy([ { name: 'test'} , { name: 'foo' } ], dataService.items); | |
| }); |
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
| const DaysEnum = {"MONDAY":1, "TUESDAY":2, "WEDNESDAY":3}; | |
| Object.freeze(DaysEnum); |
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
| $size: 8; | |
| $margins: (mb: margin-bottom, mt: margin-top, mr: margin-right, ml: margin-left); | |
| @each $key, $item in $margins { | |
| @for $i from 1 through $size { | |
| .#{$key}-#{$i} { | |
| #{$item}: (2em * $i) / 4; | |
| } | |
| } |
NewerOlder