This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
umount /dev/sdb1 | |
sudo mkdosfs -n 'USB-Drive-Name' -I /dev/sdb -F 32 | |
sudo dd if=filename.iso of=/dev/sdb bs=4k | |
sync | |
sudo eject /dev/sdc | |
# isohybrid filename.iso # only if there is "Missing Operating System" error in booting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tm(tape, transform, startState, endStates, i){ | |
currState = startState; | |
while(currState is not in endStates){ | |
sym = (tape[i])? tape[i]: 'Blank'; | |
state = transform[currState][sym]; | |
if(!state) return 'Not Halting'; | |
tape[i] = state.w; // write sym | |
i += state.m; // move tape | |
currState = state.n; // move to next state | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@addAttributeToUrl: (url, key, val) -> | |
return url if _.some arguments, (arg) -> | |
arg == null or arg == '' | |
#regex = (all non-# or non-?)(0-1: # or ?)(all non-blanks) | |
regex = /([^\?#]*)([?#]?)([^\s]*)/ | |
match = regex.exec(url.trim()) | |
baseUrl = match[1] | |
separator = match[2] | |
queryString = match[3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terminateEvent = function(event){ | |
event.stopPropagation(); // Stops Bubbling up to Ancestor elements | |
event.preventDefault(); // Stops the default action Eg : Redirecting to a "href" for anchor element | |
return false; | |
} | |
$("#anchor-element").click( function(event){ | |
//Do something | |
return terminateEvent(); | |
}); |