Skip to content

Instantly share code, notes, and snippets.

View RobertDaleSmith's full-sized avatar
🎮
Adapting controllers

Robert Dale Smith RobertDaleSmith

🎮
Adapting controllers
View GitHub Profile
var unfollowNext = () => {
var followButtons = $('.following button.following-text.button-text');
if (followButtons && followButtons[0]) {
$(window).scrollTop(followButtons.offset().top-250);
followButtons[0].click();
} else {
$(window).scrollTop(99999999999999999);
}
var randNextTime = Math.floor(Math.random() * 2000) + 500;
t = setTimeout(unfollowNext, randNextTime);

Keybase proof

I hereby claim:

  • I am RobertDaleSmith on github.
  • I am robertdalesmith (https://keybase.io/robertdalesmith) on keybase.
  • I have a public key whose fingerprint is 072C 1E03 49F1 4720 E583 113A 3ECB 4FBB F0AC E0E4

To claim this, I am signing this object:

@RobertDaleSmith
RobertDaleSmith / osx-for-hackers.sh
Created March 14, 2016 16:19 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
alias sync-itunes='rsync -av --force --delete --size-only /Volumes/robert/Music/iTunes /Volumes/DataHD/Users/robert/Music'
@RobertDaleSmith
RobertDaleSmith / time-complexity.js
Created November 20, 2015 23:15
Used to compare time it takes execute two different javascript lines.
function test(option){
var start = Date.now();
var result;
if(option){
result = $('body').find('p + p + p').parent();
}else{
result = $('body').find(':has(> p + p + p)');
}
var end = Date.now();
return (end - start);
@RobertDaleSmith
RobertDaleSmith / sumo.bash_profile
Last active June 25, 2018 17:40
Robert's Sumo Bash_Profile
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \w\[\033[36m\]\$(parse_git_branch)\[\033[00m\] $ "
alias redisstart='sudo launchctl start io.redis.redis-server'
alias redisstop='sudo launchctl stop io.redis.redis-server'
alias edit='open -a "Sublime Text"'
alias subl='open -a "Sublime Text"'
@RobertDaleSmith
RobertDaleSmith / gist:a54d96961aacd980615e
Created June 20, 2015 07:54
Get YouTube ID from URL
function getYouTubeID(url){
var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
var match = url.match(regExp);
if (match&&match[7].length==11){
return match[7];
}else{
return "";
}
}
/* Trello Node.js Developer Challenge - Solution
*
* https://trello.com/jobs/developer
*
* If hash is defined by the following pseudo-code:
*
* Int64 hash (String s) {
* Int64 h = 7
* String letters = "acdegilmnoprstuw"
* for(Int32 i = 0; i < s.length; i++) {