<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Matt Mcnamee on Medium]]></title>
        <description><![CDATA[Stories by Matt Mcnamee on Medium]]></description>
        <link>https://medium.com/@mcnamee?source=rss-9c6871161689------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*a8fo4_7e6fBYDdfwZJtgiA.jpeg</url>
            <title>Stories by Matt Mcnamee on Medium</title>
            <link>https://medium.com/@mcnamee?source=rss-9c6871161689------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 22:19:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mcnamee/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to build a GraphQL API]]></title>
            <link>https://mcnamee.medium.com/how-to-build-a-graphql-api-73786f7b7c80?source=rss-9c6871161689------2</link>
            <guid isPermaLink="false">https://medium.com/p/73786f7b7c80</guid>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[api-development]]></category>
            <category><![CDATA[prisma]]></category>
            <dc:creator><![CDATA[Matt Mcnamee]]></dc:creator>
            <pubDate>Wed, 20 Mar 2019 05:25:15 GMT</pubDate>
            <atom:updated>2019-03-22T02:00:21.093Z</atom:updated>
            <content:encoded><![CDATA[<p>Perhaps you’ve heard about GraphQL and sold on the concept. Now you’re looking at how to get a scalable and ‘best practice’ GraphQL API up and running.</p><p><a href="https://www.prisma.io/">Prisma</a> is a great option. With tens of thousands of Github stars, hundreds of contributors and backed by a well-funded &amp; for-profit company (which has raised a few million $ by investors from companies like Heroku, Netlify and Algolia) — Prisma is a solid and growing product.</p><p>Today we’ll take a look at what and why you should consider using <a href="https://www.prisma.io/">Prisma</a> and <a href="https://github.com/prisma/graphql-yoga">GraphQL-Yoga</a> to build a GraphQL API.</p><h3>The Prisma architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*pkNbdH2AeUWOZbvxitMwzA.png" /></figure><ul><li><strong>The Client</strong> (eg. a mobile app and/or website) connects to a GraphQL server — this is where <a href="https://github.com/prisma/graphql-yoga">GraphQL-Yoga</a> comes in:</li><li><strong>The GraphQL Server</strong> — GraphQL-Yoga (provided by the Prisma team) is a great GraphQL server which talks to Prisma nicely and uses the popular <a href="https://www.apollographql.com/docs/apollo-server/">Apollo Server</a> <em>under-the-hood</em>. The GraphQL server contains our custom business-logic — everything from CRUD operations, authentication &amp; authorization, database schema, migrations, seeders etc. Our GraphQL server obviously needs data, and this is where Prisma steps in:</li><li><a href="https://www.prisma.io/"><strong>Prisma</strong></a> sits between the business logic and the database, acting as an ORM (you’ll see <em>why</em> soon — keep reading). Prisma can be run on its own server (optional) to enhance your scaling options or run it on the same server as your database (eg. with Docker).</li><li><strong>Database </strong>— currently Prisma can talk to MySQL, Postgres and MongoDB. Your database can sit on the same server as Prisma or you could use a database-as-a-service such as <a href="https://m.do.co/c/ac827a1a72f9">Digital Ocean’s Managed DB</a> or <a href="https://aws.amazon.com/rds/">AWS RDS</a>.</li></ul><p>When I first read about the Prisma architecture, I felt a bit uneasy. At first, the added complexity of having <em>another</em> (the Prisma layer) service to manage seemed unnecessary. When I learned <em>why</em>, it started to make sense, so keep reading.</p><h3>What does Prisma do?</h3><p>Prisma is a <em>data layer</em> that replaces traditional ORMs in your application architecture. The key features ‘<em>on-the-box</em>’ are:</p><ul><li>Enables realtime subscriptions (no matter the database)</li><li>Auto-generates type-safe database access</li><li>Supports SQL and NoSQL DBs and handles joins and filtering via a consistent and seamless API</li><li>Handles migrations and seeding</li><li>Has a visual data management interface</li></ul><h3>So, <em>Why Prisma</em>?</h3><p>The following features convinced me that the Prisma way is a great option and robust pattern for building a GraphQL API.</p><h4>1. Realtime data streaming</h4><p>The majority of database types (eg. MySQL, Postgres) don’t support realtime streaming (letting clients subscribe to changes happening to the database). Implementing this realtime feature means that we need additional services (eg. Pusher) and can get complex.</p><p>Prisma’s dedicated data-layer provides a realtime API for every (supported) database, letting you subscribe to any database event (eg. data create, update or delete) without any fuss.</p><h4>2. Scalable Architecture</h4><p>A lot of the complexity in designing your application architecture, comes from query optimization, performance and security. Industry titans (eg. Facebook, Twitter) implement a DAL (data access layer) to abstract complexities of database access. The DAL provides an API to be consumed by the application server, allowing us to think about what data we need rather <em>how to</em> securely and performantly retrieve it from the database.</p><p>Prisma is an auto-generated DAL which follows the same principles as industry-leading DALs (such as <a href="https://about.sourcegraph.com/graphql/graphql-at-twitter">Twitter’s Strato</a> or <a href="https://www.facebook.com/notes/facebook-engineering/tao-the-power-of-the-graph/10151525983993920/">Facebook’s TAO</a>). Prisma allows you start your project with a clean architecture from the beginning.</p><p>What’s more, the GraphQL-Yoga component of the stack can be deployed “serverless-ly” via <a href="https://serverless.com/">Serverless Framework</a> to AWS Lambda (or the like).</p><h4>3. DX — Up and Running Quick</h4><p>Purely based on my own experience: I was able to get up and running with Prisma and GraphQL-Yoga relatively quickly. I tried a few Prisma competitors (Apollo Server, AWS AppSync) but had the best DX (developer experience) with Prisma. From local development, staging and deploying to production — Prisma has some great CLIs and other helpful tooling to get moving.</p><h4>4. Longevity</h4><p>Let’s be honest, learning a new platform can be draining. If we’re investing time and energy into something new, we should be confident it’s not going to ‘<em>go away</em>’ any time soon. After reviewing Prisma, it would appear that the company and team supporting it is showing markers of longevity and the community is active and responsive.</p><h3>Get Started with Prisma &amp; GraphQL-Yoga</h3><p>You may now be interested to try out Prisma. I’ve created a boilerplate Prisma project with a bunch of basics that you may need to start your next project:</p><ul><li>Authentication and Authorisation</li><li>Example data types/models</li><li>An opinionated boilerplate file structure</li><li>Tooling to help in dev and to deploy</li><li>Subscription example</li></ul><p>You’ll also find helpful instructions to get you started in both dev and in production (I’ll link you to the repo’s instructions as it’ll be kept up to date):</p><p><a href="https://github.com/mcnamee/graphql-server-boilerplate">mcnamee/graphql-server-boilerplate</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73786f7b7c80" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PHPCS Code Linting for Wordpress]]></title>
            <link>https://mcnamee.medium.com/phpcs-code-linting-for-wordpress-c340199364c6?source=rss-9c6871161689------2</link>
            <guid isPermaLink="false">https://medium.com/p/c340199364c6</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[wordpress-development]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Matt Mcnamee]]></dc:creator>
            <pubDate>Mon, 21 Jan 2019 05:42:12 GMT</pubDate>
            <atom:updated>2021-05-16T23:03:41.236Z</atom:updated>
            <content:encoded><![CDATA[<p>‘Linting’ automatically analyses your code for potential errors and ensures it’s formatted according to a definition. There are tools to lint your code across many programming language and can be customised on a per project basis to <strong>increase code quality &amp; consistency, improved performance and reduce developer decision making fatigue</strong>.</p><p>This guide will help you setup Code Linting for your Wordpress project.</p><h3>1. Installation</h3><p>Using <a href="https://getcomposer.org/">Composer</a> — Install <a href="https://github.com/squizlabs/PHP_CodeSniffer">PHPCS</a> and the <a href="https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards">Wordpress Coding Standards</a>, to your local machine:</p><pre>composer global require squizlabs/php_codesniffer wp-coding-standards/wpcs</pre><p>Add the Wordpress Coding Standard to the PHPCS list of available standards:</p><pre># Windows/Mac<br>phpcs --config-set installed_paths ~/.composer/vendor/wp-coding-standards/wpcs</pre><pre># Ubuntu<br>phpcs --config-set installed_paths ~/.config/composer/vendor/wp-coding-standards/wpcs</pre><p>To test it’s working, from the command line, you should now be able to run:</p><pre>phpcs -i</pre><p>Which will return:</p><pre>The installed coding standards are PEAR, Zend, PSR2, MySource, Squiz, PSR1, PSR12, <strong>WordPress, WordPress-Extra, WordPress-Docs and WordPress-Core</strong></pre><h3>2. Project Config</h3><p>The first step is to setup project-specific linting configuration. There’s a couple of benefits in making it project-specific (opposed to globally defining config):</p><ol><li>The config can be shared across team members</li><li>You can use different config for different projects — a Wordpress code style guide for Wordpress projects but not a Laravel project for example</li></ol><p>In the root (or perhaps even just in your theme or plugin — depends on how much you’re writing) of your <em>project</em>, track the following phpcs.xml file (note that this is for Wordpress):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b28b5b1d5c8a3ba3a4c48e8f27312f27/href">https://medium.com/media/b28b5b1d5c8a3ba3a4c48e8f27312f27/href</a></iframe><p>To lint a single file through the Wordpress Code Standards — eg. the header.php, you can now run:</p><pre>phpcs header.php</pre><p>For me, this returned the follow error because I had a function like so: function foo($bar) however Wordpress Standards want it like so: function foo( $bar )</p><pre>FILE: /Users/Matt/Sites/pvtl/web/app/themes/pvtl/header.php<br>--------------------------------------------------------------------<br>FOUND 1 ERROR AFFECTING 1 LINE<br>--------------------------------------------------------------------<br>1 | ERR | [x] No space before closing parenthesis is prohibited<br>(WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeCloseParenthesis)<br>--------------------------------------------------------------------<br>PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>--------------------------------------------------------------------</pre><pre>Time: 243ms; Memory: 8Mb</pre><h3>3. Realtime Feedback</h3><p>PHPCS is now working in our terminal, however the real benefit comes from error and standards checking in <em>realtime</em>. We can setup our IDEs to give us this immediate feedback as we code.</p><h4>3.1 VS Code</h4><p>There are plugins/extensions for most IDEs, I’ll highlight how to set it up in Visual Studio Code (VSCode):</p><ol><li>Install the <a href="https://marketplace.visualstudio.com/items?itemName=ikappas.phpcs">VSCode PHPCS</a> extension</li><li>Open settings.json (CMD + Shift+ P) and add the following to the settings object (replacing &lt;absolute/path/to&gt; with your own path):</li></ol><p>Windows/Mac:</p><pre>&quot;phpcs.executablePath&quot;: &quot;/<strong>&lt;absolute/path/to&gt;</strong>/.composer/vendor/squizlabs/php_codesniffer/bin/phpcs&quot;,<br>&quot;phpcs.standard&quot;: &quot;./phpcs.xml&quot;,</pre><p>Ubuntu:</p><pre>&quot;phpcs.executablePath&quot;: &quot;/<strong>&lt;absolute/path/to&gt;</strong>/.config/composer/vendor/squizlabs/php_codesniffer/bin/phpcs&quot;,<br>&quot;phpcs.standard&quot;: &quot;./phpcs.xml&quot;,</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9VkCZOKPp3sK4Fqu7M7Yiw.png" /><figcaption>From the ‘Problems’ tab (CMD+Shift+P ‘View: Toggle Problems’) — you’ll see the linting errors. You’ll also notice the red underlines within the code.</figcaption></figure><h4>3.2 Sublime Text</h4><ol><li>Install the <a href="https://github.com/SublimeLinter/SublimeLinter">SublimeLinter</a> and <a href="https://github.com/SublimeLinter/SublimeLinter-phpcs">SublimeLinter-phpcs</a> extensions</li><li>Open Preferences.sublime-settings (CMD + ,) and add the following to the settings object (you can use which phpcs to find the path to PHPCS):</li></ol><p>Windows/Mac:</p><pre>&quot;SublimeLinter.linters.phpcs.executable&quot;: &quot;~/.composer/vendor/bin/phpcs&quot;,</pre><p>Ubuntu:</p><pre>&quot;SublimeLinter.linters.phpcs.executable&quot;: &quot;~/.config/composer/vendor/bin/phpcs&quot;,</pre><p>From there, you can use the command palette (CMD + p) to “show all errors” and then “lint this view”. I personally edit the SublimeLinter’s settings, to make the linting happen in the background (“lint_mode”: “background”).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c340199364c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scalable Web Development Environments]]></title>
            <link>https://mcnamee.medium.com/scalable-web-development-environments-8c140c7dbe37?source=rss-9c6871161689------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c140c7dbe37</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Matt Mcnamee]]></dc:creator>
            <pubDate>Sun, 20 May 2018 06:35:29 GMT</pubDate>
            <atom:updated>2018-05-20T07:19:39.685Z</atom:updated>
            <content:encoded><![CDATA[<p>Before I start, I should clarify that when I refer to a <em>web development environment</em>, I’m talking about the software, configuration and tooling that web developers use when they’re building a website. Alright, let’s jump in.</p><h3>⚠️ The Problem</h3><p>It goes without saying that every developer has their own preference to the tools they use; usually based on the experience and familiarity with each tool.</p><p>When talking web development environments, consider the endless combinations of configurations for a PHP developer:</p><ul><li>John prefers Windows with WAMP</li><li>Jenny uses a Mac with MAMP (free version)</li><li>Jake likes Mac uses MAMP Pro</li><li>Jill prefers Ubuntu with everything installed natively</li><li>Jack uses a Mac, and likes creating Docker containers for each project</li><li>etc etc etc — endless combinations right?</li></ul><p>If each of these developers are working individually, they may be super productive and have no issues. The problem comes when all of these developers are on the same team. See, it’s difficult not just to maintain each person’s uptime (eg. &lt;insert whiny voice&gt;<em>MAMP updated and now my sites aren’t working…</em>&lt;/whiny voice&gt;), but also to ensure consistency.</p><p>When we have consistency, we benefit because:</p><ul><li>Debugging issues are easier as everyone’s on the same page</li><li>The product that everyone’s working on, is working exactly the same on John’s machine as it is on Jane’s. No more <em>“well it was working on mine with PHP5.6.34…”</em></li><li>The team will all use the same procedures and processes, meaning less barrier to entry and more efficient work</li></ul><h3>🙌 The Solution</h3><p>Docker, and it’s really fairly simple to setup and use.</p><blockquote>Docker is software that performs operating-system-level virtualization also known as containerization.</blockquote><p>Hmmm…what does that mean? It essentially means that you can write some fairly straight-forward configuration, which will install everything from an operating system to a specific version of PHP, within a sandboxed container.</p><p>You can distribute this configuration to your team, they’ll run it within Docker and each person will have exactly the same development configuration. When you add requirements to your environment (eg. perhaps your company starts using Composer or Gulp), you can simply update the config, re-distribute and everyone will be up to date.</p><p>Another benefit is that Docker is compatible across operating systems — so Mac lovers can continue using a Mac, Windows to Windows etc.</p><p>A really simple example would look something like this:</p><pre># docker-compose.yml</pre><pre>version: &#39;1&#39;<br>services:<br>  db:<br>    container_name: db<br>    image: &quot;mysql:5.7&quot;<br>    ports:<br>      - &quot;3306:3306&quot;<br>  web:<br>    container_name: web<br>    image: &quot;php:7.1-apache&quot;<br>    ports:<br>      - &quot;80:80&quot;</pre><p>Running this configuration would create:</p><ul><li>A Database container with MySQL 5.7</li><li>A Web container with Apache and PHP 7.1</li></ul><p><em>That exact example may or may not work, it’s a stripped back example to show the basic structure</em></p><h3>👨🏼‍💻 Let’s see it working</h3><p>First up, there are some prerequisites for Docker:</p><ul><li>Your machine must be MacOS, Windows 10 Pro or Linux</li><li>Your CPU must support virtualisation (Intel VT-x or AMD-V)</li></ul><h4>Step 1. Install Docker</h4><p>Head on over to <a href="https://docs.docker.com/compose/install/">https://docs.docker.com/compose/install/</a>, download, install and open Docker Compose for your OS.</p><h4>Step 2. Docker Config</h4><p><a href="https://github.com/pvtl/docker-dev">Here’s one I prepared earlier</a>. Amongst other things, this set of config will give you everything you need for a typical day in PHP land:</p><ul><li>PHP 7.1.x (default) as well as PHP 5.6.X</li><li>MySQL 5.7</li><li>Composer</li><li>NodeJS (and NPM)</li><li>Mailhog (for testing email)</li></ul><p>You could fork this repo and modify it to your own team’s needs, or simply use it as is.</p><p>Either way, let’s dive in with this configuration for now. Clone the repo to your machine:</p><pre>git clone https://github.com/pvtl/docker-dev &amp;&amp; cd docker-dev</pre><p>Make your own environment file:</p><pre>cp .env.example .env</pre><p>Open .env and for now, just update the DOCUMENTROOT= variable to point to the absolute path of where your websites live on your computer (eg. I put all my websites under a ~/Sites directory). For each website in your document root, you&#39;ll need to add a host file override (on a Mac, the host file is located /etc/hosts) - eg. if I have a site in folder ~/Sites/info/, I&#39;ll add 127.0.0.1 info.localhost to my host file.</p><h4>Step 3. Let’s run it</h4><p>Finally, start let’s build and start our new dev environment:</p><pre>docker-compose up -d</pre><p>The first time you run this, it may take some time as it will download and build all of the dependencies (eg. Linux, PHP, MySQL etc).</p><p>Once this finishes, the Docker environment will be running in the background.</p><h4>🚀 Done…Let’s test</h4><ul><li>Create a folder in your document root called info (eg. ~/Sites/info)</li><li>Add 127.0.0.1 info.localhost to your host file</li><li>Create a file within the new folder called index.php with &lt;?php phpinfo(); as the file contents</li><li>Visit info.localhost in your browser and you should see:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h9N3EIZL-uVZe3BiXVa5Wg.png" /><figcaption>We have a PHP server running!</figcaption></figure><p>You can also add 127.0.0.1 info.php5.localhost to your host file and visit info.php5.localhost in your browser and you should see:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6S69ha7xHM7I-SYRAcSYjg.png" /><figcaption>Oh what? We have a PHP 5 server running too?!</figcaption></figure><p>Notice that just by adding php5 to the URL, the Docker environment will know to use PHP5 instead of PHP7 (helpful if your working on a legacy codebase).</p><p>To close Docker, simply run docker-compose down (from the directory where you cloned the config) and then quit Docker. There&#39;s also more documentation in the repo for this configuration - eg. how to SSH into the container.</p><p>In case it’s not clear, you can (and should?) bundle as many of your standard development tools inside your Docker container. For example we bundle NPM, Composer, Wordpress CLI, Gulp CLI etc. All CLI commands are then executed from within Docker.</p><blockquote>If a new developer started at your company with a fresh machine — wouldn’t it be great to simply say — clone our Docker local development environment and they’ll have everything they need? Now you can</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c140c7dbe37" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Open Source Software to Build Your Instagram Followers]]></title>
            <link>https://mcnamee.medium.com/using-open-source-software-to-build-your-instagram-followers-205f908cf657?source=rss-9c6871161689------2</link>
            <guid isPermaLink="false">https://medium.com/p/205f908cf657</guid>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Matt Mcnamee]]></dc:creator>
            <pubDate>Fri, 14 Apr 2017 03:05:21 GMT</pubDate>
            <atom:updated>2020-02-16T07:05:38.219Z</atom:updated>
            <content:encoded><![CDATA[<p>I stumbled across <a href="https://github.com/timgrossmann/InstaPy">InstaPy</a> last week and have been eager to get some time to give it a go. Simply put, it’s an Instagram Like, Comment and Follow Automation Script. Reading through <a href="https://medium.com/u/fc204c62b387">TimG</a>’s <a href="https://medium.freecodecamp.com/my-open-source-instagram-bot-got-me-2-500-real-followers-for-5-in-server-costs-e40491358340">post</a> was kind-a inspiring. <strong>Through his script, he’s managed to get 2,500+ real followers on Instagram in 4 months, for only ~$5 p/month on hosting fees.</strong></p><p>Needless to say, I wanted to see how well it could work for a side project of mine.</p><p>Ashamedly, I spent about 1.5hrs fumbling my way through getting it working — primarily because I had no Python experience at all. Eventually I got it up and running, so here’s a guide to help you.</p><h3>1. Setup a Server</h3><ul><li>Spin up for a $10 <a href="https://m.do.co/c/ac827a1a72f9">DigitalOcean</a> droplet — select <em>One Click Apps</em> &gt; <em>Docker</em><br>- <em>Important</em> — Chrome (a dependency of InstaPy) didn’t like running on anything less than 2GB ram<br>- This literally takes about 1-2mins with <a href="https://m.do.co/c/ac827a1a72f9">DigitalOcean</a>!<br>- Make sure you add your computer’s SSH key, so that you don’t need a username/password</li><li>SSH into your new box, via ssh root@&lt;IP ADDRESS&gt;</li><li>Issue the following commands to get the server ready:</li></ul><pre># Check for any server updates before we start<br><strong>sudo apt-get update</strong></pre><pre># Install docker-compose in case it&#39;s not there<strong><br>apt install docker-compose</strong></pre><pre># Install unzip, so we can unzip .zip packages<br><strong>apt install unzip</strong></pre><h3>2. Download InstaPy</h3><pre><strong>cd ~/ &amp;&amp; wget </strong><a href="https://github.com/InstaPy/instapy-docker/archive/master.zip"><strong>https://github.com/InstaPy/instapy-docker/archive/master.zip</strong></a><strong><br>unzip master.zip</strong></pre><h3>3. Configure your Automation</h3><pre># Update docker_quickstart.py with our own config<br><strong>cd instapy-docker-master/docker-compose/<br>cp docker_quickstart.py.example docker_quickstart.py<br>nano docker_quickstart.py --softwrap</strong></pre><p>Read through the InstaPy docs to see what’s possible, but here’s a default for you to get started:</p><pre>from instapy import InstaPy<br>from instapy.util import smart_run</pre><pre># Write your automation here<br># Stuck ? Look at the github page or the examples in the examples folder</pre><pre>insta_username = &#39;&#39;<br>insta_password = &#39;&#39;</pre><pre>dont_like = [&#39;bad&#39;, &#39;terrible&#39;, &#39;hot&#39;, &#39;girl&#39;]<br>ignore_words = [&#39;bad&#39;, &#39;terrible&#39;, &#39;horrible&#39;, &#39;hate&#39;]<br>friend_list = []<br>tag_list = [&#39;blog&#39;, &#39;blogger&#39;, &#39;marketing&#39;, &#39;bloggerlife&#39;, &#39;bloggergirl&#39;, &#39;bloggerstyle&#39;, &#39;fashionista&#39;, &#39;bloggerlove&#39;, &#39;fashionblogger&#39;, &#39;blogging&#39;]<br>comments = [&#39;🔥&#39;, &#39;👍&#39;, &#39;🤯&#39;]</pre><pre># If you want to enter your Instagram Credentials directly just enter<br># username=&lt;your-username-here&gt; and password=&lt;your-password&gt; into InstaPy<br># e.g like so InstaPy(username=&quot;instagram&quot;, password=&quot;test1234&quot;)</pre><pre>bot = InstaPy(username=insta_username, password=insta_password, headless_browser=True)<br>with smart_run(bot):<br>    bot.set_relationship_bounds(enabled=True,<br>                                potency_ratio=-1.21,<br>                                delimit_by_numbers=True,<br>                                max_following=5555,<br>                                min_followers=45,<br>                                min_following=45)<br>    bot.set_do_comment(True, percentage=10)<br>    bot.set_comments(comments)<br>    bot.set_do_follow(enabled=True, percentage=50, times=2)<br>    bot.set_dont_unfollow_active_users(enabled=True, posts=5)<br>    bot.unfollow_users(amount=60, instapy_followed_enabled=True, instapy_followed_param=&quot;nonfollowers&quot;, style=&quot;FIFO&quot;, unfollow_after=90*60*60, sleep_delay=501)<br>    bot.set_dont_include(friend_list)<br>    bot.set_dont_like(dont_like)<br>    bot.set_ignore_if_contains(ignore_words)<br>    bot.like_by_tags(tag_list, amount=100)<br>    bot.end()</pre><h3>4. Build and Start Docker</h3><p>InstaPy uses Docker to house all of the dependencies for the project, meaning you don’t need to install each one, one by one. It’s as simple as running:</p><pre># Build InstaPy<br><strong>docker-compose up -d --build &amp;&amp; docker-compose down</strong></pre><pre># Start InstaPy<br><strong>docker-compose up -d --build</strong></pre><p>You can see what it’s doing at any time, by viewing the server via the logs:</p><pre><strong>docker logs --tail 50 -f $(docker ps -a | grep instapy | cut -d &quot; &quot; -f 1)</strong></pre><h3>5. Keep it running…non-stop</h3><p>We’ll setup a cron to make sure it continues to run on a schedule. The following makes it start up every 12hrs.</p><pre># Setup a Cron to keep it running<br><strong>EDITOR=nano crontab -e</strong></pre><pre># This will open the cron scripts<br># Paste the following to the bottom of the file<br><strong>0 */4 * * * cd ~/instapy-docker-master/docker-compose/ &amp;&amp; /usr/bin/docker-compose down<br>1 */4 * * * cd ~/instapy-docker-master/docker-compose/ &amp;&amp; /usr/bin/docker-compose up -d --build</strong></pre><p>That’s it. I’ll report back with any findings!</p><h3>Extra</h3><p>I also create a quick script to restart the container/script for convenience:</p><pre><strong>echo &#39;cd ~/instapy-docker-master/docker-compose/ &amp;&amp; docker-compose down &amp;&amp; docker-compose up -d --build &amp;&amp; docker logs --tail 50 -f $(docker ps -a | grep instapy | cut -d &quot; &quot; -f 1)&#39; &gt; ~/restart.sh</strong></pre><p>Which you can run by simply typing:</p><pre><strong>bash ~/restart.sh</strong></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=205f908cf657" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linting for React Native]]></title>
            <link>https://medium.com/pvtl/linting-for-react-native-bdbb586ff694?source=rss-9c6871161689------2</link>
            <guid isPermaLink="false">https://medium.com/p/bdbb586ff694</guid>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Matt Mcnamee]]></dc:creator>
            <pubDate>Wed, 02 Nov 2016 00:34:32 GMT</pubDate>
            <atom:updated>2020-02-27T03:51:42.058Z</atom:updated>
            <content:encoded><![CDATA[<p>Linting is the process of running your code through a tool to analyse for potential errors. Linting isn’t language specific and can be customised on a per project basis to ensure <strong>code quality, improved performance, reduce developer decision making fatigue and consistency</strong>.</p><p>Here’s a few examples of where linting can help:</p><ul><li>Show me when I’ve defined a variable, but haven’t used it (OR show me when I’ve used a variable but never defined it!)</li><li>Error when I’ve got a syntax error (eg. missing a closing parentheses)</li><li>Show me when there’s a more performant way to write that (eg. with Javascript, I may have written something the ‘old’ ES5 way, but my project is setup for ES6+, so use the more performant version of that code)</li><li>Show me an error when I’m not abiding by my team’s code standards (eg. always use spaces and not tabs or our code standards may say that object definitions should always have a dangling comma)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*ptkCNng9IWaKJ_cvw04FJA.png" /><figcaption>I’ve missed a semi-colon — our code standards state that we need one. My linter shows me an error then and there.</figcaption></figure><h3>Sounds too good to be true. How how how?</h3><p>So far we’ve been introduced to linting. Let’s get setup. This guide will walk you through getting setup with linting for React Native (JS) development, but you can apply the same principles for any language.</p><p>Linting requires a few tools (once you’re setup, it’ll be silky smooth, promise).</p><h4>1. Define a Code Styleguide</h4><p>We didn’t have a code styleguide — the process to define all of the individual syntax choices seemed pretty daunting. Instead of re-inventing the wheel, we looked through the styleguides from the “big-boys” of the industry and landed on <a href="https://github.com/airbnb/javascript">AirBnB’s Javascript styleguide</a>.</p><p>Get your developers to review and agree to use your chosen styleguide as a central source of truth.</p><h4>2. IDE Plugins</h4><p>First up, let’s install a linter into your code editor of choice. These will work together to show you the warnings/errors on demand.</p><ul><li><strong>VS Code</strong> — <a href="https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint">ESLint</a></li><li><strong>Sublime Text 3</strong> — <a href="http://www.sublimelinter.com/en/latest/">SublimeLinter</a> and SublimeLinter-contrib-eslint</li><li><strong>Atom</strong> — <a href="https://github.com/steelbrain/linter">Linter</a> and <a href="https://atom.io/packages/linter-eslint">Linter-eslint</a></li><li><strong>PHPStorm</strong> — <a href="https://plugins.jetbrains.com/plugin/7494">ESLint</a></li><li><em>Others? Let me know in the comments</em></li></ul><p>I’ve configured my IDE plugin to analyse code both when I open a file + when I hit save. Mine shows me errors/warnings in the gutter, a squiggly line under the code in question + when I hit save, it pops up and gives me more info.</p><h4>3. Per project devDependencies</h4><p>Our code editor is now setup to lint our code, however it needs to know what and how to lint. On a per project basis, you’ll simply need to install some NodeJS devDependencies and also produce a .eslintrc configuration file to wire up the plugins and rules to use.</p><p><strong>2.1 Let’s install some devDependencies to our project:</strong></p><ul><li>The Linter to run the processing — we chose <a href="http://eslint.org/">ESLint</a></li></ul><pre>npm install eslint eslint-plugin-import eslint-plugin-react eslint-plugin-jsx-a11y --save-dev</pre><ul><li>Linter plugin/s, to define your rules — we really liked <a href="https://github.com/airbnb/javascript">AirBnB’s Javascript styleguide</a> which also comes with all the matching ESLint rules + it‘s built for React development</li></ul><pre>npm install eslint-config-airbnb --save-dev</pre><ul><li>We use ES7 syntax like Javascript classes in React Native, so we‘ll need to use <a href="https://github.com/babel/babel-eslint">babel-eslint</a> as our parser</li></ul><pre>npm install babel-eslint --save-dev</pre><p><strong>Wire it all together:</strong></p><p>Good news is, that everything’s installed, now it’s time to wire it together via a magical .eslintrc configuration file.</p><p>Create a .eslintrc file in the projects root with the following:</p><pre>{<br>  &quot;extends&quot;: &quot;airbnb&quot;,<br>  &quot;parser&quot;: &quot;babel-eslint&quot;,<br>  &quot;ecmaFeatures&quot;: {<br>    &quot;classes&quot;: true<br>  },<br>  &quot;rules&quot;: {<br>    &quot;react/jsx-filename-extension&quot;: [&quot;error&quot;, { &quot;extensions&quot;: [&quot;.js&quot;, &quot;.jsx&quot;] }]<br>  }<br>}</pre><h3>Conclusion</h3><p>If everything’s working correctly, you should be able to simply hit save and you’ll very likely get some errors (example shown below).</p><p>You can also run a command in terminal, to analyse and report back on all files at once (instead of going into each file in your IDE to look for errors):</p><pre>./node_modules/.bin/eslint -c .eslintrc — ext .js src</pre><p>Don’t be too afraid of the errors. It’ll likely be minor syntax issues, changing tabs to spaces and things like that. Instead of refactoring the whole project in one go, we decided to refactor files as we touch them.</p><p>Overall, it feels super clean when everyone’s forced to follow the same styleguide!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*3P4P3rOfl6UlnUJko_MQxg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bdbb586ff694" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pvtl/linting-for-react-native-bdbb586ff694">Linting for React Native</a> was originally published in <a href="https://medium.com/pvtl">pvtl</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Native Android Development for Mac]]></title>
            <link>https://medium.com/pvtl/react-native-android-development-on-mac-ef7481f65e47?source=rss-9c6871161689------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef7481f65e47</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Matt Mcnamee]]></dc:creator>
            <pubDate>Mon, 31 Oct 2016 07:59:27 GMT</pubDate>
            <atom:updated>2017-03-20T23:01:03.470Z</atom:updated>
            <content:encoded><![CDATA[<p>I develop a lot with <a href="https://facebook.github.io/react-native/">React Native</a>, which compiles to both iOS and Android. Getting started with React Native iOS development is particularly simple as you just download Xcode from the Mac AppStore, and away you go. Android…not so much. The RN Getting Started guide is ok, but there’s a few extra steps it doesn’t cover.</p><p>This article aims to be a guide to get setup with an Android Development environment, specifically for React Native on macOS Sierra.</p><h3>1. Install Android Studio</h3><p>Firstly, let’s refer to the <a href="https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment">React Native installation guide, for Android</a>. We’ll download Android Studio (about 450MB).</p><p>Drag Android Studio into your Applications folder and then Open Android Studio. You’ll be presented with a Setup Wizard — let’s run through that:</p><p>Tick both ‘Performance’ and ‘Android Virtual Device’ to get an optimised Android Virtual Device for testing. This has got a bit to download, the Android SDK and Virtual Device are quite big…go get a coffee or something</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*Z_Zo_pe3jKilYoo4V8SXnQ.png" /></figure><h3>2. Setup Paths</h3><p>While that’s downloading, let’s setup paths to the Android SDK (so that the RN CLI knows where it is):</p><p>Open terminal and create/edit your .bash_profile file:</p><pre>nano ~/.bash_profile</pre><p>This will open a file called .bash_profile in terminal. Next, paste the following to the bottom of the file:</p><pre># Android SDK<br>export ANDROID_HOME=~/Library/Android/sdk<br>export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools</pre><p>Then save and close the file (CMD + x, yes, enter).</p><h3>3. Install JDK for Mac OSX</h3><p>The Android CLI requires the Java Developer Kit (JDK) — simply download and install it:</p><p><a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">Java SE Development Kit 8 Downloads</a></p><h3>4. Install the extras</h3><p>There’s a few extra things that we need to install to get us up and running. Bear with me…</p><h4>4.1 Google Play Services</h4><p>Install Google Play Services (for things like Google Analytics, Google Login etc).</p><ul><li>Open Android Studio &gt; Configure &gt; SDK Manager</li><li>Go to the middle ‘<strong>SDK Tools</strong>’ &gt; Click ‘<strong>Show Package Details</strong>’ (bottom right)</li><li>Click ‘<strong>Google Play Services</strong>’, then hit apply and follow the instructions to download/install it</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kYfrof9OfO3CuEPIXBOu2g.png" /></figure><h4>4.2 Android System Images</h4><p>In order to create new emulators, we need to install a few system images.</p><ul><li>Run android sdk from terminal</li><li>Check the 3 system images selected below (Android TV Intel x86 Atom System Image, Google APIs Intel x86 Atom 64 System Image, Google APIs Intel x86 Atom System Image)</li><li>Hit Install 3 Packages and follow the prompts to install</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*QwOcoVOy2Dbtzr_dbTSJ1Q.png" /></figure><h3>4.3 Android 6.0</h3><p>By default you’ll get the latest and greatest SDKs installed. But React Native and most of their plugins use the Android 6.0 SDK build tools. So you’ll need to install that to run/build your app.</p><ul><li>Open Android Studio &gt; Configure &gt; SDK Manager</li><li>Click on the blue link ‘Launch Standalone SDK Manager’ (bottom left)</li><li>Check the 2 system images selected below (Android 6.0 SDK Platform and Android 6.0 Google APIs Intel x86 Atom System Image)</li><li>Hit Install 2 Packages and follow the prompts to install</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*-eSCt2xhhr3zkItDwzv3ZA.png" /></figure><h3>5. Running a React Native App in the Android Simulator</h3><p>Now is a good time to do a quick restart of the machine, before moving on. Then, from terminal, run:</p><pre>android avd</pre><p>This will open the Android Virtual Device Manager. If you don’t have any devices setup, create one with similar settings to below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*fmMKahoau0DY9gp_iNoq7w.png" /></figure><p>Click ok, then select the device to open, and click Start.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*AnonMn8g_kaqB3c4fiuxyQ.png" /></figure><p>Wait for that device to fire up (keep that terminal window open). Then, in a new terminal window, enter the root directory of your React Native project, then run:</p><pre>react-native run-android</pre><p>Things change all the time, let me know in the comments if something doesn’t quite work and I’ll look into updating this.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef7481f65e47" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pvtl/react-native-android-development-on-mac-ef7481f65e47">React Native Android Development for Mac</a> was originally published in <a href="https://medium.com/pvtl">pvtl</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Trust to be trusted]]></title>
            <link>https://mcnamee.medium.com/trust-to-be-trusted-8d165f85b22f?source=rss-9c6871161689------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d165f85b22f</guid>
            <category><![CDATA[management]]></category>
            <category><![CDATA[teamwork]]></category>
            <category><![CDATA[leadership]]></category>
            <dc:creator><![CDATA[Matt Mcnamee]]></dc:creator>
            <pubDate>Sat, 30 Jan 2016 12:44:24 GMT</pubDate>
            <atom:updated>2022-03-05T08:51:48.885Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m sure you’d agree that earning the trust of your team is essential to producing a high performing and healthy unit. If team members don’t trust their leader, they tend not to communicate well with the leader or others within the team, and lack of communication…well that doesn’t lead to successful results. It’s also been shown that trust leads to better employee engagement, motivation, openness (especially in regard to challenges) and happiness. Performance aside, how healthy can the culture be when distrust is in the air?</p><p>Here’s a quick summary of some things I’ve learnt and experienced that can help build a trust.</p><h4>Communicate well</h4><p>We can communicate, however if we don’t communicate well, we may tell a different story. Give consideration to both what and how you communicate your messages, don’t just wing it. If nothing else, be intentional about the key idea you want the recipient/s to walk away with.</p><h4>Display humble competence</h4><p>Continue to learn and upskill. You need to know what you’re talking about and be able to talk the same language to gain trust. However it’s always better to do this with a humble heart…and by the way never claim to be ‘the expert&#39;.</p><h4>Form relationships</h4><p>Spend time with individuals, learn things about them through conversation, remember what’s important to them. It’s important to show that it’s not all business, you’re a team and you’re in it together.</p><h4>Be transparent</h4><p>Be transparent with your information. When you leave a gap in any information, you’re in a face off against the rumormill as staff fill the void with their own assumptions.</p><h4>Take blame and give credit</h4><p>It’s important to give credit to the team for success and even individuals where you can. If you take all the credit, why would someone want to continue to do faceless work? Furthermore take the blame for the team, show that you’re a fearless leader who ‘has their back’. People need to feel trusted, so that they can try things and it be safe to fail.</p><h4>Trust people</h4><p>All of the above are pointless unless you trust your people. After all, why should someone trust you, if you can’t trust them? If you can’t trust their abilities/skills just yet, that’s ok (work with them) — but at the very least convey trust in their intentions and character.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d165f85b22f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Show Confidence Under Pressure]]></title>
            <link>https://mcnamee.medium.com/show-confidence-under-pressure-768b50413ee5?source=rss-9c6871161689------2</link>
            <guid isPermaLink="false">https://medium.com/p/768b50413ee5</guid>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[customer-service]]></category>
            <category><![CDATA[self-improvement]]></category>
            <dc:creator><![CDATA[Matt Mcnamee]]></dc:creator>
            <pubDate>Tue, 26 Jan 2016 11:22:06 GMT</pubDate>
            <atom:updated>2016-01-26T11:29:11.250Z</atom:updated>
            <content:encoded><![CDATA[<p>I was recently in a doctor’s office explaining my symptoms, when I noticed that he was growing more and more anxious, the more I explained. It’s not as if he was a newbie, I’d seen this doctor for years and I knew that he’d been in the profession for decades. His hands were fidgeting, he was murmuring things like ‘erm’, ‘this doesn’t make sense’, ‘but this medication is the same as &lt;insert big doctor word&gt;…’. Overall it was clear that he wasn’t confident in whatever his diagnosis/prescription/suggestion was going to be.</p><p>His lack of confidence made me very nervous and uncomfortable. If a man of his expertise and experience didn’t know what was happening with my health, what hope did I have?</p><blockquote>Reflecting later that night, I realised that revealinlack of confidence can have a negative effect on our interactions in any part of life — be it professional or personal.</blockquote><p>People engage us and customers pay us to get things done and solve problems. By portraying a lack of confidence, we only unnecessarily burden them emotionally. Even if you solve the problem, if you’ve left them nervous temporarily while you murmur away negative thoughts, they’ve had a negative experience with you and will lose confidence themselves that you know what you’re doing. Perhaps they think that you only solved it by chance and you’re not the best person to help out next time.</p><p>This isn’t to say fake it, lie and pretend to know what you’re talking about. If you don’t know something, simply let them know that it’s not in your realm of expertise, but you’ll find out who is best to consult on that topic or simply that you’ll do some research and report back. This is better than — ”ugh well, I think I heard that, um Google now, um reads keywords, from um…”.</p><p><strong>Shouldn’t our desire be to leave people with great memories of their interaction with us? Do your best to portray that you’ve got a handle on each situation. Exude confidence.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=768b50413ee5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>