Skip to content

Instantly share code, notes, and snippets.

@arlaneenalra
arlaneenalra / array_splice.php
Last active December 28, 2015 06:29
A crude array_splice that preserves keys.
<?php
function array_splice_preserve ($input, $offset, $length, $replacement) {
$keys = array_keys($input);
$values = array_values($input);
array_splice($keys, $offset, $length, array_keys($replacement));
array_splice($values, $offset, $length, array_values($replacement));
return array_combine($keys, $values);
};
@arlaneenalra
arlaneenalra / procSize.sh
Created November 15, 2013 13:33
Calculate the average RSS size, total RSS size, and number of a given set of processes and display the results once a second.
#!/bin/sh
while (true) ; do clear; ps aux | grep apache | grep -v grep | awk '{sum+=$6} END {print "Total Size = ", sum; print "Averae Size = ", sum/NR; print "Number Of Processes = ", NR}'; sleep 1; done
@arlaneenalra
arlaneenalra / gist:54e46a2e2ece9ecac6a9
Created January 19, 2015 15:28
Git lg alias with date order
[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative --color --date-order
@arlaneenalra
arlaneenalra / A few interesting make targets
Created May 24, 2016 19:51
A few interesting make targets for phpcs ...
get-branch:
# make sure that origin pointers are up to date
@git fetch
$(eval BRANCH = "$(shell git rev-parse --abbrev-ref HEAD)")
$(eval MERGE_BASE = "$(shell git merge-base $(BRANCH) origin/develop)")
# all committed changes
$(eval FILES_COMMITTED = $(shell git diff --name-only $(MERGE_BASE)))
-- HANDLE SCROLLING WITH MOUSE BUTTON PRESSED
local scrollMouseButton = 3
local deferred = false
overrideOtherMouseDown = hs.eventtap.new({ hs.eventtap.event.types.otherMouseDown }, function(e)
-- print("down")
local pressedMouseButton = e:getProperty(hs.eventtap.event.properties['mouseEventButtonNumber'])
-- print(pressedMouseButton)
if scrollMouseButton == pressedMouseButton
then
@arlaneenalra
arlaneenalra / # python - 2019-10-09_07-10-55.txt
Created October 21, 2019 16:25
python on macOS 10.14.6 - Homebrew build logs
Homebrew build logs for python on macOS 10.14.6
Build date: 2019-10-09 07:10:55
@arlaneenalra
arlaneenalra / # python - 2019-10-09_07-10-55.txt
Created October 22, 2019 12:37
python on macOS 10.14.6 - Homebrew build logs
Homebrew build logs for python on macOS 10.14.6
Build date: 2019-10-09 07:10:55
@arlaneenalra
arlaneenalra / # python - 2019-10-09_07-10-55.txt
Created October 22, 2019 13:00
python on macOS 10.14.6 - Homebrew build logs
Homebrew build logs for python on macOS 10.14.6
Build date: 2019-10-09 07:10:55
@arlaneenalra
arlaneenalra / # python - 2019-10-22_08-18-39.txt
Created October 22, 2019 13:20
python on macOS 10.15 - Homebrew build logs
Homebrew build logs for python on macOS 10.15
Build date: 2019-10-22 08:18:39
@arlaneenalra
arlaneenalra / # python - 2019-10-22_08-18-39.txt
Created October 22, 2019 13:24
python on macOS 10.15 - Homebrew build logs
Homebrew build logs for python on macOS 10.15
Build date: 2019-10-22 08:18:39