Following up on my previous Let’s Build an angular app with Browserify post I got a few questions on how to create modules for your app. Let me show you. -- If you haven’t already, make sure you’ve read the walkthrough on how to set up the environment to work with Browserify and Gulp, so you can follow along. Basically, what you do when you require() a module, is looking for what the script you require exposes to the outside world through module.
When I realised you could easily generate screenshots from a site with PhantomJS I just needed to know if I could take it one step further, and record a video. The goal What I wanted was to record 10 seconds of video from a random website and output it as a .mp4. For this short demo I decided we should go with one of the fun examples on Pixi.JS as they’re interesting to capture.
Today I want to show a generic workflow and setup I have used a lot lately when working on building apps with Angular. It uses Gulp as a CI system and Browserify to minimize code clutter and maximize awesomeness. So let’s jump in. Update 21 october 2014 - Frickle As with most things, boilerplates evolve. I decided to expand the boilerplate we’re building below with a backend for the API side, as well as cleaning up some things based on new findings and updated modules.
If you develop a website that uses multiple environments such as development, staging and production you probably have a configuration file of sorts to handle things like database settings, mail server credentials, and so on for your backend system. But how do you handle such variables in the front-end? Specifically, in an AngularJS App? For instance, you might have a seperate API you’re talking to for your content, which has a different location locally, than on your production server.
I just want to mention CabinJS. It took me all of 10 minutes to set it up, and another 10 to get the automatic deployment to Github Pages working. The other 4 hours this sunday I spent on layouting, designing and tweaking the blog you’re reading now. And that’s pretty sweet. There’s quite a few static site generators on the market today, of which Jekyll probably is the most famous, but CabinJS elevates a minimalistic setup combined with Grunt tasks to a new level of awesomeness.
Stumbled upon HTTPie, a command line HTTP client. It’s pretty awesome. Basically it’s Curl on steroids, as it has an easy interface and syntax highlighted output. Here’s an example of a simple GET request to the Bacon Ipsum JSON service: Of course you can do actual useful stuff as well, such as POST-ing, Authentication, Cookies, Custom Headers, etc. As the repo says, the main features are: Expressive and intuitive syntax Formatted and colorized terminal output Built-in JSON support Forms and file uploads HTTPS, proxies, and authentication Arbitrary request data Custom headers Persistent sessions Wget-like downloads Python 2.
I just wanted to quickly share a shell alias I have been using lately to get some more color in the terminal when you cat a file. Below is a screenshot of what an average terminal looks like when you just use $ cat somefile.js Sure, it does the job, and you probably are ok with it looking dull as hell. But what if you could make it look like this:
I love the terminal. Besides the fact it makes you look awesome while using it, it can also do about a gazillion different things. Most of them useful. One thing is for sure, while developing webapps I have it running all the time and spend a lot of time running commands and monitoring output. So why not make it look as pretty as it is awesome? In this short walkthrough I’ll explain how to customize the terminal to make it look like mine, but make sure you fiddle with the settings so it works best for you.
So there we go. Writing this post in vim. Macvim to be exact. Trying not to touch the arrow keys, not use the h-j-k-l too extensively either, work with A and I a lot, and generally trying not to cock things up too much by hitting the wrong commands. So why do I willingly put myself through the torture of using the monster that is Vim? Well, just like a lot of developers out there, I’ve had a long time desire to be able to use Vim properly.
Just a quick note, the CakePHP PHPUnit installer has been updated to use version 3.7.8. Go grab it here if you are no fan of PEAR and want a self contained PHPUnit testing system. Works on Mac OSX, Linux and Windows.