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({ |
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({ | |
firstName:'joe', | |
lastName:'dirt' | |
}); |
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
'use strict'; | |
import _ from "lodash"; | |
/** | |
* Mixin to update the `width` state based on the DOM element's width whenever | |
* the window is resized. | |
*/ | |
export default { |
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; | |
}; |
OlderNewer