Skip to content

Instantly share code, notes, and snippets.

Andrew Connell andrewconnell

Block or report user

Report or block andrewconnell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View azure-pipelines.yml
trigger:
branches:
include:
- '*'
variables:
- group: office365credentials
stages:
- stage: Build
@andrewconnell
andrewconnell / azure-pipelines.yml
Last active Oct 19, 2019
Add Search to Hugo Sites with Azure Search
View azure-pipelines.yml
- stage: live_site_post_deploy
displayName: Live site post deployment
dependsOn:
- live_site_build_deploy
# always build on pushes to master
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
jobs:
- deployment: exec_search_reindex
displayName: Reindex Azure Search
pool:
@andrewconnell
andrewconnell / decode-jwt-token.ts
Created Feb 18, 2019
Decode JTW token with TypeScript
View decode-jwt-token.ts
import jwt = require('jsonwebtoken');
const decodedValidToken = (accessToken: string) => {
const key: string = '-----BEGIN CERTIFICATE-----\nMIIDBTCCAe...\n-----END CERTIFICATE-----';
// decode & verify token
return jwt.verify(accessToken, key);
}
const authorizationHeader: string = req.headers.authorization;
View onClickHandler.tsx
export default class HelloWorld extends React.Component<IHelloWorldProps, {}> {
private foo: string = "some string";
public render(): React.ReactElement<IHelloWorldProps> {
return (
<button type="button" onClick={ this.onClickHandler }>
trigger problem
</button>
);
}
View package.json wish
{
"name": "iPityDaFool",
"version": "0.0.1",
"private": true,
"scripts": {
"build": "gulp bundle",
"clean": "gulp clean",
"test": "gulp test"
},
"dependencies": {
@andrewconnell
andrewconnell / repository.yml
Last active Sep 16, 2019
Automate Building, Testing and Deploying SharePoint Framework Projects with Azure Pipelines in Two Steps
View repository.yml
resources:
repositories:
- repository: azure-pipelines-spfx-templates
type: github
name: voitanos/azure-pipelines-spfx-templates
endpoint: voitanos-github
View VS Settings - Normal.cmd
@echo off
echo Setting Visual Studio Settings to: "AC Settings.settings"
"C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe" /ResetSettings
"C:\Documents and Settings\\[PROFILE_NAME\]\My Documents\Visual Studio 2005\Settings\AC.vssettings"
View OnLoad.js
protected override void OnLoad(EventArgs e) {
// fully qualified name of the script
string scriptName ="JAXCC2006WebParts.CustomVerbsMenu.js"
// obtain reference to the page's client script manager
ClientScriptManager csMgr = Page.ClientScript;
// obtain the URL to the embedded JavaScript file in this assembly
string scriptURL = csMgr.GetWebResourceUrl(this.GetType(), scriptName);
View spfx-readme.md

<%= libraryName %>

This is where you include your project's documentation.

Building the code

Requires Gulp globally installed:

npm install --global gulp
View azure-pipelines-header.yml
trigger:
branches:
include:
- '*'
schedules:
- cron: "3 12,15,17,22 * * Mon-Fri"
displayName: Daily build of live site
branches:
include:
- master
You can’t perform that action at this time.