Skip to content

Instantly share code, notes, and snippets.

View mikeyjk's full-sized avatar
🕹️

mikeyjk mikeyjk

🕹️
View GitHub Profile
@mikeyjk
mikeyjk / .bashrc
Created January 27, 2015 08:38
FogBugz diff screen file path contains erroneous characters (Issue may be exclusive to Win7 + Chrome with *nix VM)
# work around for fogbugz diff screen
function toAscii() {
vim $(echo $1 | iconv -t ascii//TRANSLIT)
}
alias vimc='toAscii'
@mikeyjk
mikeyjk / Action JavaScriptlet
Last active August 29, 2015 14:14
Silent Mode for Android Lollipop (requires root access and Tasker application)
disable = shell("chmod 044 sys/class/timed_output/vibrator/enable", true, 0);
enable = shell("chmod 777 sys/class/timed_output/vibrator/enable", true, 0);
@mikeyjk
mikeyjk / Action JavaScriptlet
Last active August 29, 2015 14:14
Custom Facebook Messenger Notification Sound (requires root access and Tasker application)
musicPlay("/system/media/audio/notifications/Shaula.ogg", 0, 0, "");
If $SILENT neq on
AND
$SILENT neq vibrate
@mikeyjk
mikeyjk / Action JavaScriptlet
Created January 30, 2015 17:52
Change Android Wallpaper On Display On (requires root access and Tasker application)
var images = listFiles($folder, false).split("\n");
var select = Math.floor(Math.random() * (images.length));
setWallpaper(images[select]);
@mikeyjk
mikeyjk / optionalParam.css
Last active January 27, 2016 03:24
Optional parameter test SCSS.
background: #FFFFFF;
background: url("http://placehold.it/350x150") left no-repeat, -webkit-linear-gradient(#FFFFFF, #000000);
background: url("http://placehold.it/350x150") left no-repeat, -o-linear-gradient(#FFFFFF, #000000);
background: url("http://placehold.it/350x150") left no-repeat, -moz-linear-gradient(#FFFFFF, #000000);
background: #FFFFFF;
background: -webkit-linear-gradient(#FFFFFF, #000000);
background: -o-linear-gradient(#FFFFFF, #000000);
background: -moz-linear-gradient(#FFFFFF, #000000);
jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
"change select submit keydown keypress keyup contextmenu" ).split( " " ),
function( i, name ) {
// Handle event binding
jQuery.fn[ name ] = function( data, fn ) {
return arguments.length > 0 ?
this.on( name, null, data, fn ) :
this.trigger( name );
@mikeyjk
mikeyjk / module-name.module.php
Last active February 18, 2016 03:33
Attach #after_build to field in form_alter.
<?php
function hook_form_alter(&$form, &$form_state, $form_id) {
if ($form_id === 'expected_form_name') { // Assuming content type containing list field.
if (isset($form['field_settings_list'])) {
$settingsForm = &$form['field_settings_list'];
$settingsLang = $settingsForm['#language'];
$settingsForm[$settingsLang]['#after_build'][] = 'field_settings_list_after_build';
}
}
}
@mikeyjk
mikeyjk / SassMeister-input.scss
Created October 28, 2016 02:39 — forked from mturjak/SassMeister-input.scss
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
$numbers: ("3": "three", "4": "four");
@each $number, $i in $numbers {
.#{$i}-#{$number} {
/* CSS styles */
@mikeyjk
mikeyjk / s3rm.js
Created May 1, 2018 07:20
jQuery for deleting S3 assets via web UI
jQuery('.columbia-table.object-table-versioned > table > tbody > tr').each(function () {
if (
jQuery(this).find('td a.list-view-item-name') &&
// jQuery(this).find('td a.list-view-item-name').text().indexOf("Apr 4, 2018 2:04:00 PM") >= 0 &&
jQuery(this).find('td a.list-view-item-name').text().indexOf("(Delete marker)") >= 0
) {
jQuery(this).find('td input').click();
}
});
@mikeyjk
mikeyjk / nice-wrapper.sh
Created May 2, 2019 08:38
grep logs being 'nicer' to CPU and IO
nice -n 19 ionice -c3 $yourStuff