Skip to content

Instantly share code, notes, and snippets.

@dudelis
dudelis / azure-function-sample.js
Last active January 5, 2019 00:22
K2: Integrate Azure Function with REST ServiceBroker
module.exports = async function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
if (req.query.name || (req.body && req.body.name)) {
var output = req.query.name || req.body.name;
context.res = {
// status: 200, /* Defaults to 200 */
body: {
'output': output
}
@milankorsos
milankorsos / redux-actions.ts
Last active November 10, 2022 10:58
Correct TypeScript typing example for Redux Thunk actions
import {Action, ActionCreator, Dispatch} from 'redux';
import {ThunkAction} from 'redux-thunk';
// Redux action
const reduxAction: ActionCreator<Action> = (text: string) => {
return {
type: SET_TEXT,
text
};
};
@amysimmons
amysimmons / js-tricky-bits.md
Last active November 16, 2022 02:42
Understanding closures, callbacks and promises in JavaScript

#Understanding closures, callbacks and promises

For a code newbie like myself, callbacks, closures and promises are scary JavaScript concepts.

10 months into my full-time dev career, and I would struggle to explain these words to a peer.

So I decided it was time to face my fears, and try to get my head around each concept.

Here are the notes from my initial reading. I'll continue to refine them as my understanding improves.

@brandonmwest
brandonmwest / example.cs
Last active January 16, 2024 15:52
Generating base64-encoded Authorization headers in a variety of languages
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Basic",
Convert.ToBase64String(
System.Text.ASCIIEncoding.ASCII.GetBytes(
string.Format("{0}:{1}", username, password))));
@digitaljhelms
digitaljhelms / gist:4287848
Last active April 23, 2024 21:43
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch