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
#!/usr/bin/perl | |
use Image::Magick; | |
$imagePath = "../images/"; | |
@sizes = ("480", "768", "992", "1200"); | |
#reading sub, takes argument (filename) | |
sub resizeFiles { |
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
while true;do sleep 1; echo 0 > /sys/devices/platform/thinkpad_acpi/leds/tpacpi::thinklight/brightness;sleep 1;echo 1 > /sys/devices/platform/thinkpad_acpi/leds/tpacpi::thinklight/brightness;done; |
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 links = []; | |
var casper = require("casper").create(); | |
require('utils'); | |
//this filter looks for external links | |
function isLinky(linky) { | |
var pattern = /^((http|https|ftp):\/\/)/; | |
if(pattern.test(linky)) | |
return linky; | |
} |
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
class App extends React.Component { | |
render() { | |
return( | |
<div> | |
<PrettyLoader> | |
<Lies/> | |
</PrettyLoader> | |
<PrettyLoader> | |
<DamnedLies /> |
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
class PrettyLoader extends React.Component { | |
render() { | |
let loaderStyles = classNames({ | |
'hidden': this.props.loading | |
}); | |
return( | |
<div> | |
<div className={loaderStyles} /> | |
{this.props.children} |
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
class Endpoints { | |
static login(auth_params) { | |
return { | |
method: 'POST', | |
endpoint: 'users/login', | |
loading_message: 'Loggin You In', | |
body: JSON.stringify(auth_params) | |
} | |
} | |
// More static methods that just return an object |
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
class NeatoComponent extends React.Component { | |
render() { | |
// Guard clause | |
if (this.props.user === undefined) { | |
return null; | |
} | |
/* | |
* Actual render code here | |
*/ | |
} |
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
class NeatoComponent extends React.Component { | |
constructor() { | |
super(); | |
this.state = { | |
foo: this.props.foo, | |
bar: this.props.bar | |
} | |
} | |
render() { |
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
class NeatoComponent extends React.Component { | |
constructor() { | |
super(); | |
this.state = { | |
foo: this.props.foo, | |
bar: this.props.bar | |
}; | |
} | |
componentWillReceiveProps(nextProps) { |
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 filterMyArray(filterProperty) { | |
let _ = this.myArray.concat(); // safely copy myArray (which is an array of objects) | |
let filtered = _.filter((i) => { | |
return i.propery === filterPropery | |
}); | |
return filtered; | |
} |
OlderNewer