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 prompt = require("gulp-prompt"); | |
// Promts you to choose a task | |
gulp.task('default', function() { | |
var taskNames = []; | |
for (var taskName in gulp.tasks) { | |
if (gulp.tasks.hasOwnProperty(taskName)) { | |
taskNames.push(taskName); | |
} | |
} |
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
// Move list items up or down or swap | |
$scope.moveItem = function (array, origin, destination) { | |
var temp = array[destination]; | |
array[destination] = array[origin]; | |
array[origin] = temp; | |
}; | |
// Move list item Up | |
$scope.listItemUp = function (itemIndex, array) { | |
$scope.moveItem(array, itemIndex, itemIndex - 1); |
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
#include <SPI.h> | |
#include <Wire.h> | |
#include <Adafruit_GFX.h> | |
#include <Adafruit_SSD1306.h> | |
#include <Wire.h> | |
void setup() | |
{ | |
Wire.begin(); | |
Serial.begin(9600); | |
while (!Serial); |
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 path = require('path'); | |
const MiniCss = require('mini-css-extract-plugin'); | |
module.exports = (env = {}, argv = {}) => { | |
const config = { | |
mode: argv.mode || 'development', // we default to development when no 'mode' arg is passed | |
// mode: argv.mode || 'production', // we default to development when no 'mode' arg is passed | |
entry: { | |
main: path.join(__dirname, 'styles', 'index.scss'), |
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
async function GetFields(listTitle){ | |
let data = await fetch(`${_spPageContextInfo.siteServerRelativeUrl}/_api/web/lists/GetByTitle('Users')/Fields?$filter=Hidden%20eq%20false`, | |
{ | |
headers: {"Accept":"application/json;odata=verbose"} | |
}); | |
let fields = await data.json(); | |
console.log(fields.d.results.map(field=>`${field.Title} | ${field.InternalName}\n\r`).join("") ); | |
} |
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
{ | |
"extends": "eslint:recommended", | |
"parserOptions": { | |
"ecmaVersion": 6, | |
"sourceType": "module", | |
"ecmaFeatures": { | |
"jsx": true | |
} | |
}, | |
"rules": { |
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
$ npm install mocha chai ts-node -g | |
$ npm install --save-dev mocha chai ts-node @types/chai @types/mocha | |
Article: https://medium.com/@FizzyInTheHall/run-typescript-mocha-tests-in-visual-studio-code-58e62a173575 |
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
@ECHO OFF | |
PowerShell.exe -Command "& '%~dpn0.ps1' -path '%~dp0'" | |
REM PAUSE |
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
import * as React from "react"; | |
export default class ErrorBoundary extends React.Component<any, | |
{ hasError: boolean; error: any; errorInfo: any }>{ | |
constructor(props) { | |
super(props); | |
this.state = { hasError: false, error: "", errorInfo: "" }; | |
} | |
public componentDidCatch(error: any, errorInfo: any) { |
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.logline "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
$ git logline |
OlderNewer