Skip to content

Instantly share code, notes, and snippets.

View sethwebster's full-sized avatar

Seth Webster sethwebster

View GitHub Profile
### Keybase proof
I hereby claim:
* I am sethwebster on github.
* I am sethwebster (https://keybase.io/sethwebster) on keybase.
* I have a public key whose fingerprint is 1455 B70C 6E9D EACA DF22 1E58 FDE6 0C0B 581B 3A8A
To claim this, I am signing this object:
// Run this on another thread since the signalr client doesn't like it
// when we spend a long time processing messages synchronously
Task.Factory.StartNew(() =>
{
string content = message.Content;
string name = message.User.Name;
// Ignore replies from self
if (name.Equals(Name, StringComparison.OrdinalIgnoreCase))
{
<service xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app" xml:base="https://wgccnuget.corp.intuit.net/api/v1/FeedService.svc/">
<workspace>
<atom:title>Default</atom:title>
</workspace>
</service>
var Packages = PackageRepo.GetAll()
.Where(p => !p.IsPrerelease)
.ToV1FeedPackageQuery(Configuration.SiteRoot);
@sethwebster
sethwebster / FbPageInviteAll.js
Created November 30, 2013 13:22
*** NOTE: This is the non-minified version for reading. A minified, bookmarklet-ready version of this is here: https://gist.github.com/sethwebster/7719079 For Facebook Pages only, invite all friends to like page. At the time of this writing, this works. Facebook changes things up pretty frequently so YMMV. First, add this code as bookmarklet, th…
var popup = null;
var total = 0;
function inviteNext(currentIndex,list){
if (currentIndex<list.length) {
total++;
list[currentIndex].click();
currentIndex++;
setTimeout(function() { inviteNext(currentIndex,list); },100);
updateCount();
}
addUser() {
echo "Adding user $1..."
adduser $1
gpasswd -a $1 sudo
}
enableSwap() {
echo "Enabling Swap..."
sudo fallocate -l 4G /swapfile
sudo mkswap /swapfile
{
"caret_style": "phase",
"color_scheme": "Packages/Colorsublime - Themes/Afterglow.tmTheme",
"fade_fold_buttons": false,
"folder_exclude_patterns":
[
"node_modules",
"bower_components",
".svn",
".git",
@sethwebster
sethwebster / FbPageInviteAllBookMarklet.js
Created November 30, 2013 13:26
For Facebook Pages only, invite all friends to like page. At the time of this writing, this works. Facebook changes things up pretty frequently so YMMV. First, add this code as bookmarklet, then, when inviting friends, scroll to the bottom of your list to ensure they're all loaded. Finally, click the bookmarklet. Viola, all friends invited.
javascript:function inviteNext(e,t){if(e<t.length){total++;t[e].click();e++;setTimeout(function(){inviteNext(e,t)},100);updateCount()}else{destroyPopup()}}function updateCount(){var e=document.getElementById("invite-all-count-sw");e.innerText=total+"/"+els.length}function createPopup(){var e=document.getElementsByTagName("head")[0];var t=document.getElementsByTagName("body")[0];var n=document.createElement("div");n.setAttribute("id","add-all-div-sw");n.setAttribute("style",'text-align:center;font-family:"lucida grande",tahoma,verdana,arial,sans-serif;padding:20px;width:25%;height;20%;border:2px solid #ccc;background-color:#fff;position:relative;margin:0 auto 0 auto');n.innerHTML='Inviting Everyone in the List...<span id="invite-all-count-sw">0</span> invited so far...';t.appendChild(n);popup=n}function destroyPopup(){popup.parentElement.removeChild(popup)}var popup=null;var total=0;var els=document.getElementsByClassName("uiButton _1sm");createPopup();inviteNext(0,els)
@sethwebster
sethwebster / update-authors.sh
Last active May 15, 2017 17:26
Script to rewrite a list of authors in git history
#!/bin/bash
#
# +-----------------------+
# | Update Authors Script |
# +-----------------------+-------------------------------------------------------------------------+
# | |
# | Updates wrong authors and maps them to the new Git authors |
# | |
class ThereCanBeOnlyOne {
timeout = null;
performAction(waitMs, action) {
if (this.timeout) this.cancelPrevious();
return new Promise((resolve, reject) => {
this.timeout = setTimeout(() => {
this.cancelPrevious();
const value = action();
if (value.then && value.catch) {