Javascript is a programming language with a peculiar twist. Its event driven model means that nothing blocks and everything runs concurrently. This is not to be confused with the same type of concurrency as running in parallel on multiple cores. Javascript is single threaded so each program runs on a single core yet every line of code executes without waiting for anything to return. This sounds weird but it's true. If you want to have any type of sequential ordering you can use events, callbacks, or as of late promises.
| curl -X POST \ | |
| -H "Authorization: key= YOUR-API-KEY" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "registration_ids": [ | |
| "YOUR-GCM-REGISTRATION-ID" | |
| ], | |
| "data": { | |
| "message": "Hello Message" | |
| }, |
Javascript is a programming language with a peculiar twist. Its event driven model means that nothing blocks and everything runs concurrently. This is not to be confused with the same type of concurrency as running in parallel on multiple cores. Javascript is single threaded so each program runs on a single core yet every line of code executes without waiting for anything to return. This sounds weird but it's true. If you want to have any type of sequential ordering you can use events, callbacks, or as of late promises.
Javascript is a programming language with a peculiar twist. Its event driven model means that nothing blocks and everything runs concurrently. This is not to be confused with the same type of concurrency as running in parallel on multiple cores. Javascript is single threaded so each program runs on a single core yet every line of code executes without waiting for anything to return. This sounds weird but it's true. If you want to have any type of sequential ordering you can use events, callbacks, or as of late promises.
| # app deps | |
| sudo yum install git | |
| # erlang deps | |
| sudo yum groupinstall "Development Tools" | |
| sudo yum install ncurses-devel openssl-devel | |
| # erlang | |
| wget http://www.erlang.org/download/otp_src_19.2.tar.gz | |
| tar -zxvf otp_src_19.2.tar.gz |
| ##### Replace 'example' anywhere with the name of your app and '*ec2ip*' with your ec2 instance ip | |
| ##### Set up your instance and make sure it's security group has ssh, http, and https open inbound and outbound | |
| ##### Don't forget to chmod 400 cert.pem | |
| ##### .deliver/config | |
| APP="example" | |
| BUILD_HOST="*ec2ip*" | |
| BUILD_USER="elixir_builder" | |
| BUILD_AT="/home/$BUILD_USER/edeliver/$APP/builds" |
| def preload_association(records) | |
| ::ActiveRecord::Associations::Preloader.new.preload( | |
| records, | |
| @association_schema, | |
| @preload_scope | |
| ).then(&:first).then do |preloader| | |
| next unless @preload_scope | |
| # The result of previous preload is memoized, ActiveRecord won't load this association again. | |
| if preloader.is_a?(::ActiveRecord::Associations::Preloader::AlreadyLoaded) | |
| owner = preloader.send(:owners).first |
| $ sudo yum install libxml2-devel | |
| Loaded plugins: fastestmirror, priorities, security | |
| Loading mirror speeds from cached hostfile | |
| amzn-main | 2.1 kB 00:00 | |
| amzn-updates | 2.3 kB 00:00 | |
| Setting up Install Process | |
| Resolving Dependencies | |
| --> Running transaction check | |
| ---> Package libxml2-devel.x86_64 0:2.7.6-4.11.amzn1 set to be updated | |
| --> Processing Dependency: pkgconfig for package: libxml2-devel-2.7.6-4.11.amzn1.x86_64 |
| #!/bin/bash | |
| ############################################### | |
| # To use: | |
| # chmod +x install-redis.sh | |
| # ./install-redis.sh | |
| ############################################### | |
| version=5.0.0 |