Skip to content

Instantly share code, notes, and snippets.

View craftfortress's full-sized avatar
:octocat:

Chris craftfortress

:octocat:
View GitHub Profile
@craftfortress
craftfortress / New microsoft-graph-client
Created November 6, 2017 17:21
Basic Example of how to rectify Microsoft Office 360 node outlook API breaking changes from 01/10/2017
var outlook = require('outlook-updated');
var queryParams = {
'$select': 'Subject,ReceivedDateTime ',
'$orderby': 'ReceivedDateTime desc',
'$top': 1
};
outlook.base.setApiEndpoint('https://outlook.office.com/api/v2.0');
outlook.base.setAnchorMailbox(email);
aws lambda update-fnction-configuration\ --function-name "TeST" \ --description $(date -u + "%Y-%m-%dT%H:%M:%M:%SZ")
@craftfortress
craftfortress / refresh
Created June 13, 2017 10:44
Lambda Refresh : Kill all open AWS Lambda Containers, create fresh new ones.
aws lambda update-fnction-configuration\ --function-name "TeST" \ --description $(date -u + "%Y-%m-%dT%H:%M:%M:%SZ")
@craftfortress
craftfortress / JenkinsTheme
Created May 26, 2017 16:01
Jenkins Theme
@import url(https://fonts.googleapis.com/css?family=Roboto:400,700,500,300);@import url(https://fonts.googleapis.com/css?family=Roboto+Mono:400,700,500,300);@keyframes a{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes b{0%{opacity:1}50%{opacity:0}to{opacity:1}}[src$="blue.png"]{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDA5Njg4IiBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptLTIgMTVsLTUtNSAxLjQxLTEuNDFMMTAgMTQuMTdsNy41OS03LjU5TDE5IDhsLTkgOXoiLz48L3N2Zz4=)}[src$="red.png"]{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjRjQ0MzM2IiBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptMSAxNWgtMnYtMmgydjJ6bTAtNGgtMlY3aDJ2NnoiLz48L3N2Zz4=)}[src$="yellow.png
@craftfortress
craftfortress / .vimrc
Created April 26, 2017 09:35
vim ~/.vimrc
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_map = '<leader>t'
let mapleader = ","
set wildignore+=*.o,*.obj,.git,*.swp,tmp,node_modules,*/vendor/**/*,*/public/**/*
syntax on
============
Git
============
git status
git branch —all
git rebase -i HEAD~3 // Remove previous 3 commits
git push origin +master // Force push
git remote -v // List all remotes
git rm -r --cached node_modules // Untrack
function screenXY(obj){
var vector = obj.clone();
var windowWidth = window.innerWidth;
var minWidth = 1280;
if(windowWidth < minWidth) {
windowWidth = minWidth;
}
//ES6 Examples
//ES6 Promises
function leFunction(){
return new Promise( (resolve, reject) => {
if( (Math.random()*100 ) > 10)
resolve("ok");
function MyCustomError(message) {
this.message = message;
this.name = "MyCustomError";
Error.captureStackTrace(this, MyCustomError);
}
MyCustomError.prototype = Object.create(Error.prototype);
MyCustomError.prototype.constructor = MyCustomError;
/// REVERSE ARRAY
var array = [1,2,3,4,5,6,7,8,9];
var leftMark = 0;
var rightMark = array.length;
reverseArray(array,leftMark,rightMark);
function reverseArray(array, leftMark, rightMark){