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 <[email protected]>
#
# 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 "[email protected]"

@bishboria
bishboria / springer-free-maths-books.md
Last active November 27, 2024 12:11
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
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
@pamelafox
pamelafox / browser.js
Created February 13, 2013 17:35
Browser banner warning
(function(wndw) {
var Browsers, OS, Platform, Versions, browser_name, browser_version, os, platform;
Versions = {
Firefox: /firefox\/([\d\w\.\-]+)/i,
IE: /msie\s([\d\.]+[\d])/i,
Chrome: /chrome\/([\d\w\.\-]+)/i,
Safari: /version\/([\d\w\.\-]+)/i,
Ps3: /([\d\w\.\-]+)\)\s*$/i,
Psp: /([\d\w\.\-]+)\)?\s*$/i
};