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
$ heroku pg:backups:capture -a APP_NAME | |
$ heroku pg:backups:download -a APP_NAME | |
$ heroku pg:credentials:url DATABASE_NAME -a APP_NAME | |
$ pg_restore --verbose --clean --no-acl --no-owner -h HOSTNAME -U USER -d DATABASE -p PORT latest.dump --password |
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
upstream heroku { | |
server myapp.herokuapp.com; | |
} | |
server { | |
server_name ~^(www\.)(?<domain>.+)$; | |
return 301 $scheme://$domain$request_uri; | |
} | |
server { |
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
git revert --no-commit <sha>..HEAD | |
git commit |
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
$ xcode-select --install | |
$ brew install openssl | |
$ virtualenv env | |
$ . env/bin/activate | |
$(env) env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install psycopg2 |
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
{ | |
"output": { | |
"text": { | |
"values": [ | |
"My name is Alexander.", | |
"You can call me Alexander", | |
"Friends call me Alex" | |
], | |
"selection_policy": "random", | |
"append": false |
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/env bash | |
echo "Database name:" | |
read db_name | |
# Delete migration folders | |
find apps -iname 'migrations*' -exec rm -rf {} \; > /dev/null 2>&1 | |
# Re-create empty migration folder with __init__ file | |
for d in apps/*; do |
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 validateForm() { | |
var fields = [ | |
'date_Inspection Date', | |
'txt_Serial Number', | |
// Add more fields here | |
]; | |
for(var i = 0; i < fields.length; i++) { | |
var field = fields[i]; | |
var value = this.getField(field).value.trim(); | |
if(value == '') { |
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> | |
<meta charset="utf-8"> | |
<title>3, 2, 1 - Go!</title> | |
<style> | |
#countdown { | |
position: absolute; | |
left: 50%; | |
top: 50%; |
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
#countdown { | |
position: absolute; | |
left: 50%; | |
top: 50%; | |
width: 100px; | |
height: 100px; | |
display: none; | |
margin: -50px 0 0 -50px; | |
border: 2px solid #cecece; | |
background-color: #fefefe; |
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
curl -v https://www.nsscreencast.com/login | |
* Trying 162.243.42.159... | |
* Connected to www.nsscreencast.com (162.243.42.159) port 443 (#0) | |
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 | |
* Server certificate: www.nsscreencast.com | |
* Server certificate: COMODO RSA Domain Validation Secure Server CA | |
* Server certificate: COMODO RSA Certification Authority | |
* Server certificate: AddTrust External CA Root | |
> GET /login HTTP/1.1 | |
> Host: www.nsscreencast.com |
NewerOlder