Skip to content

Instantly share code, notes, and snippets.

View yeomann's full-sized avatar
Hard work yields success

Danish yeomann

Hard work yields success
View GitHub Profile
@yeomann
yeomann / docker-compose.yml
Created March 17, 2021 11:01 — forked from linuxsimba/docker-compose.yml
docker-compose for MongoDB and Mongoose UI
version: '2'
networks:
mongodb_net:
driver: bridge
ipam:
driver: default
config:
# Change this subnet range if it conflicts with your personal/work network
- subnet: 192.168.213.0/24

AWS Fargate Docker Simple Deployment Setup with SSL termination

How to:

  • create a Docker-based AWS Fargate/ECS deployment
  • without the Docker containers having a public IP
  • with an Application Load Balancer as reverse proxy / SSL termination proxy sitting in front of the containers

For Fargate/ECS to be able to access your Docker images hosted on ECR (or somewhere else) you'll have to allow outbound internet access to the Fargate subnets. Here's how you do it.

@yeomann
yeomann / react-terminology.md
Created July 26, 2020 16:16 — forked from sebmarkbage/react-terminology.md
React (Virtual) DOM Terminology
@yeomann
yeomann / react-terminology.md
Created July 26, 2020 16:16 — forked from sebmarkbage/react-terminology.md
React (Virtual) DOM Terminology
@yeomann
yeomann / countries.json
Created July 19, 2020 20:28 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@yeomann
yeomann / 0-model-override.js
Created March 6, 2019 15:34 — forked from spencermefford/0-model-override.js
An alternative to extending Loopback's built in models. In our application, we wanted to create a custom role called "ecm-administrator" that would have the ability to create and manage users.
module.exports = function (app) {
var _ = require('lodash');
var User = app.models.User;
var Role = app.models.Role;
var RoleMapping = app.models.RoleMapping;
var ACL = app.models.ACL;
/*
* Configure ACL's
*/
@yeomann
yeomann / React Native Simulators Command
Last active October 25, 2018 15:20 — forked from rexlow/md
Run React Native on specific iOS simulator version
To add a simulator
Choose Hardware > Device > Manage Devices.
Xcode opens the Devices window.
At the bottom of the left column, click the Add button (+).
In the dialog that appears, enter a name in the Simulator Name text field and choose the device from the Device Type pop-up menu.
//by default
@yeomann
yeomann / SQLite-PHP-quickstart.php
Created August 25, 2018 00:20 — forked from bladeSk/SQLite-PHP-quickstart.php
SQLite3 PHP Quickstart Tutorial
<?php
// This file walks you through the most common features of PHP's SQLite3 API.
// The code is runnable in its entirety and results in an `analytics.sqlite` file.
// Create a new database, if the file doesn't exist and open it for reading/writing.
// The extension of the file is arbitrary.
$db = new SQLite3('analytics.sqlite', SQLITE3_OPEN_CREATE | SQLITE3_OPEN_READWRITE);
@yeomann
yeomann / evaldecode.php
Created August 15, 2018 19:48 — forked from yireo/evaldecode.php
Decode evil scripts encoded with eval(gzinflate(base64_decode()))
<?php
/*
* Basic script to decrypt files encoded with eval(gzinflate(base64_decode($data)));
*/
$file = 'encrypted.php';
$content = file_get_contents($file);
function evaldecode($content, $step = 0) {
//echo "STEP $step\n";
@yeomann
yeomann / eager-prefetching-async-data-example.js
Created August 6, 2018 10:50 — forked from bvaughn/eager-prefetching-async-data-example.js
Advanced example for eagerly prefetching async data in a React component.
// This is an advanced example! It is not intended for use in application code.
// Libraries like Relay may make use of this technique to save some time on low-end mobile devices.
// Most components should just initiate async requests in componentDidMount.
class ExampleComponent extends React.Component {
_hasUnmounted = false;
state = {
externalData: null,
};