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
document.getElementsByAttribute = Element.prototype.getElementsByAttribute = function(attr) { | |
var nodeList = this.getElementsByTagName('*'); | |
var nodeArray = []; | |
for (var i = 0, elem; elem = nodeList[i]; i++) { | |
if ( elem.getAttribute(attr) ) nodeArray.push(elem); | |
} | |
return nodeArray; | |
}; |
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
var allLinks = document.querySelectorAll('a[href$=".mp3"]'); | |
var links = []; | |
for (var i = 0; i < allLinks.length; i++) { | |
links[i] = allLinks[i].getAttribute('href'); | |
} | |
//just iterate over either of these when downloading all links | |
//Opens new windows and starts download = Unwanted | |
//window.open(links[0]) |
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
var applicationViewInstance = Ember.View.views[info.GroupID]; | |
var treeNodeController = applicationViewInstance["controller"]; | |
var node = { | |
text: info.Name, | |
has_children: true, | |
type: "root", | |
"attr":{"type":"Folder","id":info.GroupID}}; | |
treeNodeController.send('toggleFromOutside',node); | |
var groupID = this.CurrentGroupID; |
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 | |
if pgrep | |
then | |
echo "exists"; | |
else | |
echo "does not exist"; | |
fi | |
#!/bin/bash | |
if pgrep -f '/usr/bin/mpd' |
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
logLines.push(pad(name, 30) + ' | ' + pad(Math.floor(node.selfTime / 1e6) + 'ms', 15)) | |
//if (node.selfTime > minimumTime) { | |
// logLines.push(pad(name, 30) + ' | ' + pad(Math.floor(node.selfTime / 1e6) + 'ms', 15)) | |
//} |
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
Discourse.Eyeline = function Eyeline(selector) { | |
this.selector = selector; | |
}; | |
Discourse.Eyeline.prototype.update = function() { | |
//content cut | |
}; | |
Discourse.Eyeline.prototype.flushRest = function() { | |
var self = this; | |
$(this.selector).each(function(i, elem) { | |
return self.trigger('saw', { detail: $(elem) }); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body onload="yourFunc()"> | |
<script type="text/javascript"> | |
function yourFunc(){ | |
var d = Date(); | |
console.log(d); |
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
ssh server -t "cd /my/remote/directory; bash --login" | |
//tip: create alias for this as follows | |
alias ssh2dir='ssh server -t "cd /my/remote/directory; bash --login"' |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
components: Ember.A([{name:'component-1'},{name:'component-2'}]) | |
}); |
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
import Ember from 'ember'; | |
const { Controller, computed, inject, RSVP } = Ember; | |
import Constants from '../../../utils/constants'; | |
const { checklistTypes } = Constants; | |
export default Controller.extend({ |
OlderNewer