Skip to content

Instantly share code, notes, and snippets.

@romixch
romixch / auth0-spa-js.tsx
Created February 5, 2020 21:33
Auth0: auth0-spa-js.js translated to Typescript
import React, { useState, useEffect, useContext, FC } from "react";
import createAuth0Client from "@auth0/auth0-spa-js";
interface Auth0ProviderProps {
children: JSX.Element;
auth0Options: Auth0ClientOptions;
onRedirectCallback: Function;
}
export interface Auth0ContextType {
@dhilipsiva
dhilipsiva / gcloud-deis-setup.sh
Last active August 5, 2020 16:56
A script to provision GCE for setting up Deis
#! /bin/bash
#
# create_instances.sh
# Copyright (C) 2016 dhilipsiva <dhilipsiva@gmail.com>
#
# Distributed under terms of the MIT license.
#
INSTANCES=3
PREFIX_APP="deisdemo-"
@coridrew
coridrew / happy_git_on_osx.md
Last active January 15, 2016 03:04 — forked from trey/happy_git_on_osx.md
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links
@anaisbetts
anaisbetts / .gitattributes
Created December 3, 2014 16:26
USE THIS GITATTRIBUTES FOR EVERY NEW PROJECT FOREVER AND EVER
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
@sdawncasey
sdawncasey / gist:332967a7de3231c76446
Created July 6, 2014 17:06
Working on a new project
<?php
class Casey {
public $hair = 'brown';
public $eyes = 'brown';
public $loves = array('monkeys', 'SciFi', 'texas', 'music');
}
$human = new Casey();
$human->birthday('2015-02-02');
$human->fingers = 10;
git log --name-only | grep php --exclude=trunk | sort | uniq -c | sort -nr | head -n 25 > churn.txt
This one looks like an odd ball but what it does is:
- looks at the git log file, retrieving just the filenames;
- greps to extract those filenames, excluding anything from the old SVN /trunk structure;
- sorts the list of files to get the duplicates together;
- eliminates the duplicates but keeps a count of them;
- resorts the file names by that count; and
@BillWagner
BillWagner / EvalOrder
Created September 5, 2013 20:47
This shows that the evaluation order of parameters is dictated by their order all that call site, not the order in the function definition.
class Program
{
static void Main(string[] args)
{
int i = 5;
EvalOrder(++i, i++); // 6, 6
Console.WriteLine(i); // 7
EvalOrder(second: ++i, first: ++i); // 9, 8
Console.WriteLine(i); // 9
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
@wumpz
wumpz / gist:5846559
Created June 23, 2013 21:12
list authors of a git repository including commit count and email
git shortlog -e -s -n