This file contains 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
ipconfig /release | |
Ipconfig /renew | |
ipconfig /flushdns | |
ipconfig /flushdns | |
ipconfig /flushdns | |
ipconfig /flushdns | |
ipconfig /flushdns |
This file contains 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
// Intercepting HTTP calls with AngularJS. | |
angular.module('MyApp', []) | |
.config(function ($provide, $httpProvider) { | |
// Intercept http calls. | |
$provide.factory('MyHttpInterceptor', function ($q) { | |
return { | |
// On request success | |
request: function (config) { | |
// console.log(config); // Contains the data about the request before it is sent. |
This file contains 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.addEventListener('invalid', (function(){ | |
return function(e) { | |
//prevent the browser from showing default error bubble / hint | |
e.preventDefault(); | |
// optionally fire off some custom validation handler | |
// myValidation(); | |
}; | |
})(), true); |
This file contains 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
.factory('User', function (Organisation) { | |
/** | |
* Constructor, with class name | |
*/ | |
function User(firstName, lastName, role, organisation) { | |
// Public properties, assigned to the instance ('this') | |
this.firstName = firstName; | |
this.lastName = lastName; | |
this.role = role; |
This file contains 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
var scores = [1, 4, 6, 8]; | |
var result = scores.reduce((total, score) => total + score) / scores.length; | |
console.log(result); // 4.75 |
This file contains 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
{ | |
"onboarding": { | |
"$contentActions": [ | |
{ | |
"input": { | |
"bypass": false, | |
"$cardContent": { | |
"document": { | |
"id": "9d471950-53e9-4461-ba75-826b1193ff51", | |
"type": "text/plain" |
This file contains 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
# curl -L git.io/antigen > "$HOME/antigen.zsh" | |
source "$HOME/antigen.zsh" | |
# Load the oh-my-zsh's library. | |
antigen use oh-my-zsh | |
antigen bundles <<EOBUNDLES | |
# Bundles from the default repo (robbyrussell's oh-my-zsh) | |
git | |
git-extras | |
z | |
docker |
This file contains 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 | |
alias git-commit='TortoiseGitProc.exe /command:commit' | |
alias git-log='TortoiseGitProc.exe /command:log' | |
alias git-diffall='TortoiseGitProc /command:showcompare /revision1:HEAD~1 /revision2:0000000000000000000000000000000000000000' | |
# Personal customization | |
# export PS1="\u@\W $ " # username @ working dir | |
export PS1="\e[1;32m\u@\e[1;34m\W\e[m $ " # username @ working dir | |
# export PS1="\e[1;32m$\e[m " # username @ working dir |
This file contains 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 { promisify } = require('util'); | |
const fs = require('fs'); | |
const readFile = promisify(fs.readFile); | |
const writeFile = promisify(fs.writeFile); | |
function readData(filename) { | |
const createMessage = data => ({ filename, data }); | |
return readFile(filename, 'utf-8').then(createMessage); | |
} |
This file contains 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 config --global alias.hist "log --pretty=format:'%C(yellow)%h%Creset %ad | %s%d %Cgreen[%an]%Creset' --graph --date=short" | |
git config --global core.safecrlf false |
NewerOlder