Note:
When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.
If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:
- Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
This content moved here: https://exploringjs.com/impatient-js/ch_arrays.html#quickref-arrays
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'; | |
////////////////////////////////// | |
// How to use? | |
// 1. Create `sequelize-schema-file-generator.js` in your app root | |
// 2. Make sure you've ran the `sequelize init` before (It should create `config`,`seeders`,`migrations` folders). | |
// 3. Update `DATABASE_DSN` below to match your connection string (works with any database adapter that Sequelize supports) | |
// 4. Run it with `node sequelize-schema-file-generator.js` | |
// 5. Review the generated migrations inside of the `migrations` folder. | |
////////////////////////////////// |
Prerequisite: dnf install golang
- Create user
geth
withuseradd
- As user
geth
fast sync the blockchain,geth --fast --cache 1024
- Manually run
geth --rpc
as user geth and watch to see that the blockchain continues to sync properly - Install the
geth.service
file (also in this gist) in/usr/lib/systemd/system/
- Make a symlink from
/etc/systemd/system/multi-user.target.wants/geth.service
to/usr/lib/systemd/system/geth.service
systemctl enable geth
followed bysystemctl start geth
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
sns.publish({ | |
TargetArn: device.arn, | |
MessageStructure: 'json', | |
Message: JSON.stringify({ | |
default: 'you will never see this muah!', | |
APNS_SANDBOX: JSON.stringify({ | |
aps: { | |
'alert': '', | |
'content-available': 1 | |
}, |
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 React from 'react'; | |
import { shallow } from 'enzyme'; | |
import MyComponent from '../src/my-component'; | |
const wrapper = shallow(<MyComponent/>); | |
describe('(Component) MyComponent', () => { | |
it('renders without exploding', () => { | |
expect(wrapper).to.have.length(1); | |
}); |
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
echo "Starting to delete versions of $APP" | |
while read ver; do | |
echo "Deleting version $ver" | |
aws elasticbeanstalk delete-application-version --version-label $ver --profile $PROFILE --application-name $APP | |
echo "Version $ver deleted!" | |
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
#!/bin/bash | |
#Force file syncronization and lock writes | |
mongo admin --eval "printjson(db.fsyncLock())" | |
MONGODUMP_PATH="/usr/bin/mongodump" | |
MONGO_HOST="prod.example.com" | |
MONGO_PORT="27017" | |
MONGO_DATABASE="dbname" | |
NewerOlder