// old
const helloWorld = React.createClass({
render() {},
});
// new
class HelloWorld extends React.Component {
render() {}
This file contains hidden or 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/expect -f | |
| set prompt "#" | |
| set address [lindex $argv 0] | |
| spawn sudo bluetoothctl -a | |
| expect -re $prompt | |
| send "remove $address\r" | |
| sleep 1 | |
| expect -re $prompt |
This file contains hidden or 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
| 1. Go to Sublime Text to: Tools -> Build System -> New Build System | |
| and put the next lines: | |
| { | |
| "cmd": ["python3", "-i", "-u", "$file"], | |
| "file_regex": "^[ ]File \"(...?)\", line ([0-9]*)", | |
| "selector": "source.python" | |
| } | |
| Then save it with a meaningful name like: python3.sublime-build |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
This file contains hidden or 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/sh | |
| runMinecraftCommand="java -Xms256M -Xmx768M -jar minecraft_server.jar nogui" | |
| startScript="start.sh" | |
| echo "Great let's get minecraft setup!" | |
| # Sanity check, do we have java installed? | |
| if ! hash java 2>/dev/null; then | |
| echo "You don't have java installed. You're gonna have a tough time." | |
| echo "Are you sure you selected the default Amazon Linux HVM ami?" |
sudo nmcli dev wifi hotspot ifname wlan0 con-name "my-hotspot" ssid "my-hotspot" password "My HotsPoT Strong Password"
More info here
This file contains hidden or 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
| ... | |
| from OpenSSL import SSL | |
| ... | |
| context = SSL.Context(SSL.TLSv1_2_METHOD) | |
| context.use_privatekey_file('/etc/letsencrypt/live/DOMAIN.COM/privkey.pem') | |
| context.use_certificate_chain_file('/etc/letsencrypt/live/DOMAIN.COM/fullchain.pem') | |
| context.use_certificate_file('/etc/letsencrypt/live/DOMAIN.COM/cert.pem') |
This file contains hidden or 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
| automation: | |
| - alias: Turn on garden lights when sun sets | |
| trigger: | |
| platform: sun | |
| event: sunset | |
| action: | |
| service: switch.turn_on | |
| entity_id: switch.garden_lights | |
| - alias: Turn off garden lights when sun rises |
- Latest Jessie Light : https://downloads.raspberrypi.org/raspbian_lite_latest
- default login/pass : pi/raspberry
- Minibian : https://minibianpi.wordpress.com/features
- expand filsystem :
sudo resize2fs /dev/mmcblk0p2
ssh empty file to the /boot partition to enable headless boot and SSH server
wpa_supplicant.conf file to the /boot partition to enable WiFi
This file contains hidden or 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
| <# | |
| .Synopsis | |
| Get a Quote for any topc | |
| .DESCRIPTION | |
| Get-Quote cmdlet data harvests a/multiple quote(s) from Web outputs into your powershell console | |
| .EXAMPLE | |
| PS > Quote -Topic "success" | |
| For me success was always going to be a Lamborghini. But now I've got it, it just sits on my drive. | |
| Curtis Jackson [50 Cent], American Rapper. From his interview with Louis Gannon for Live magazine, The Mail on Sunday (UK) newspaper, (25 October 2009). | |
| .EXAMPLE |