Skip to content

Instantly share code, notes, and snippets.

View GFoley83's full-sized avatar
☘️
CTO @ Educa

Gavin Foley GFoley83

☘️
CTO @ Educa
View GitHub Profile
@mwunsch
mwunsch / emoji_image_replace.js
Last active August 13, 2023 21:44
Detect emoji unicode on a page, replace it with images (supplied by GitHub, for now). Goes great in your ~/.js
/**
*
* Here's a thing that will look through all the text nodes of a document, and
* upon encountering an emoji codepoint, will replace it with an image.
* For now, those images are pulled from GitHub, which isn't very nice, so I
* need to find a more suitable host.
*
* Much of this code was gleaned from staring at the minified GitHub JS.
*
* Copyright (c) 2013 Mark Wunsch. Licensed under the MIT License.
@yetanotherchris
yetanotherchris / gist:4746671
Last active February 14, 2017 21:20
Unique identifiers: Base62
public static string Base62Random()
{
int random = _random.Next();
return Base62ToString(random);
}
private static string Base62ToString(long value)
{
// Divides the number by 64, so how many 64s are in
// 'value'. This number is stored in Y.
@mcollier
mcollier / AzurePublish.ps1
Created April 4, 2013 11:17
This is a sample PowerShell script to deploy a Windows Azure Cloud Service. This was written using the 0.6.11 version of the Windows Azure PowerShell cmdlets. This script also uses the Cerebrata Azure Management Cmdlets.
#NOTE: This script is based on the Microsoft provided guidance example at
# https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/.
Param(
[parameter(Mandatory=$true)]
$serviceName,
[parameter(Mandatory=$true)]
$storageAccountName,
[parameter(Mandatory=$true)]
$storageAccountKey,
@jaredwilli
jaredwilli / todoCtrl.js
Created April 27, 2013 08:30
todoFactor and TodoCtrl modules for the angularFire TodoMVC example to show an alternative example for using angularFireCollection to sync data with a Firebase by using a Factory to do so. https://github.com/firebase/angularFire/issues/24
'use strict';
todomvc.controller('TodoCtrl', [ '$scope', 'todoFactory', 'filterFilter',
function OtherCtrl($scope, todoFactory, filterFilter) {
$scope.todos = todoFactory.getAllTodos('todos');
$scope.newTodo = '';
$scope.editedTodo = '';
$scope.addTodo = function() {
todoFactory.addTodo($scope.newTodo);
};
$scope.editTodo = function(todo) {
@nzakas
nzakas / gist:5511916
Created May 3, 2013 17:47
Using GitHub inside a company

I'm doing some research on how companies use GitHub Enterprise (or public GitHub) internally. If you can help out by answering a few questions, I'd greatly appreciate it.

  1. What is the primary setup? Is there an organization and each official repo is owned by that organization?
  2. Does every engineer have a fork of each repo they're working on?
  3. Are engineers allowed to push directly to the official repo? Or must all commits go through a pull request?
  4. Do engineers work on feature branches on the main repo or on their own forks?
  5. Do you require engineers to squash commits and rebase before merging?
  6. Overall, what is the workflow for getting a new commit into the main repository?
  7. What sort of hooks do you make use of?
  8. Are there any ops issues you encountered? (Scaling, unforeseen downtime, etc.)
@ijmacdowell
ijmacdowell / adjectives.js
Last active May 5, 2024 18:53
javascript string array of nouns, adjectives, and verbs.
var adjectives = ["aback","abaft","abandoned","abashed","aberrant","abhorrent","abiding","abject","ablaze","able","abnormal","aboard","aboriginal","abortive","abounding","abrasive","abrupt","absent","absorbed","absorbing","abstracted","absurd","abundant","abusive","acceptable","accessible","accidental","accurate","acid","acidic","acoustic","acrid","actually","ad","hoc","adamant","adaptable","addicted","adhesive","adjoining","adorable","adventurous","afraid","aggressive","agonizing","agreeable","ahead","ajar","alcoholic","alert","alike","alive","alleged","alluring","aloof","amazing","ambiguous","ambitious","amuck","amused","amusing","ancient","angry","animated","annoyed","annoying","anxious","apathetic","aquatic","aromatic","arrogant","ashamed","aspiring","assorted","astonishing","attractive","auspicious","automatic","available","average","awake","aware","awesome","awful","axiomatic","bad","barbarous","bashful","bawdy","beautiful","befitting","belligerent","beneficial","bent","berserk","best","better","bewilde
@bradwilson
bradwilson / Cacheability.cs
Created January 23, 2014 20:53
Using chaining to create cached results in ASP.NET Web API v2
public enum Cacheability
{
NoCache,
Private,
Public,
}
@niksumeiko
niksumeiko / git.migrate
Last active May 13, 2024 15:34
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@plillevold
plillevold / DeployToAzure.ps1
Last active August 29, 2015 13:56 — forked from PaulStovell/DeployToAzure.ps1
Modified version of the bundled Windows Azure deployment process used by Octopus 2.0. This version will do a deploy to Staging, VIP swap to Production and then delete the Staging slot
## --------------------------------------------------------------------------------------
##
## This script is used to control how we deploy packages to Windows Azure.
## Orignial script (https://gist.github.com/PaulStovell/5234255) customized for
## Staging-To-Production with VIP swap deployment.
##
## NOTE: the script will only do Staging+VIP swap if $OctopusAzureSlot == "Staging".
## If $OctopusAzureSlot == anything else, the script will deploy directly to that slot
## without any further swapping.
##
@paully21
paully21 / aspnetmvc_discourse_sso.cs
Created February 26, 2014 16:25
ASP.NET MVC Discourse SSO Example
public ActionResult DiscourseLogin()
{
if (string.IsNullOrEmpty(Request.QueryString["sso"]) || string.IsNullOrEmpty(Request.QueryString["sig"]))
return Content("Invalid");
string ssoSecret = "YOUR SSO SECRET"; //must match sso_secret in discourse settings
string sso = Request.QueryString["sso"];
string sig = Request.QueryString["sig"];