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 / bookmarklet.js
Last active August 26, 2020 07:16
Chrome Bookmarklet for Drupal
javascript: var base = location.href.split('/'); window.location.href='http://' + base[2];
@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 / windows.ahk
Last active April 9, 2020 00:44
Windows AHK
; i3/bswp+sxhkd/awesome-esque terminal opening:
;#Enter::Run, "C:\Program Files\PuTTY\putty.exe" -load "lamp"
#enter::
Run "C:\Program Files (x86)\Mobatek\MobaXterm\MobaXterm.exe"
Return
; lcaps -> lctrl
$CapsLock::Ctrl
; set window to sit in front of all others