Skip to content

Instantly share code, notes, and snippets.

View rjmacarthy's full-sized avatar
🐁
The Tetris effect

rj rjmacarthy

🐁
The Tetris effect
  • The Wilderness
  • 00:11 (UTC +01:00)
View GitHub Profile
mysql -u root -p
@rjmacarthy
rjmacarthy / slim
Created April 20, 2016 21:57
slim
php -S localhost:8080
@rjmacarthy
rjmacarthy / array-shift.js
Created April 21, 2016 14:18
Shift an array.
var arr = [1,2,3,4];
var i = 0, times = 4;
while (i < times) {
arr.unshift(arr.pop());
console.log(arr);
i++;
}
@rjmacarthy
rjmacarthy / unique.js
Created April 21, 2016 14:41
Find a unique item in an array.
var orig = [1,1,2,2,3,3,4];
var result;
orig.forEach(function(num, i){
var test = orig.slice(0);
test.splice(i, 1)
if(test.indexOf(num) === -1){
result = num;
}
});
return result; // 4
@rjmacarthy
rjmacarthy / array-chunk-end.js
Created April 21, 2016 15:06
Get a chunk of array from the end.
var arr = [ -3, 1, 2, -2, 5, 6 ]
var chunkAmount = 3;
var chunk = arr.splice(arr.length-chunkAmount,arr.length);
console.log(chunk) // [-2, 5, 6 ]
@rjmacarthy
rjmacarthy / phpmyadmin
Created April 21, 2016 21:32
phpmyadmin
http://localhost/phpmyadmin/
@rjmacarthy
rjmacarthy / Selenium
Last active April 26, 2016 10:01
Selenium stop
http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer
selenium-standalone start
@rjmacarthy
rjmacarthy / Selenium
Created April 26, 2016 09:44
Selenium stop
http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer
# Tint2 config file
# Generated by tintwizard (http://code.google.com/p/tintwizard/)
# For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure
# Background definitions
# ID 1
rounded = 0
border_width = 0
background_color = #000000 60
border_color = #FFFFFF 16
@rjmacarthy
rjmacarthy / mongoose-count
Created May 11, 2016 22:01
Mongoose count
db.model.find({'property.1': {$exists: true}})