Vagrant. Usefull Snippets
I put together small collection of usefull commands and Vagrant file snippets.
Destroy and start new insatnce from one line:
vagrant destroy -f && vagrant up
To change parameters of virtual machine:
1 2 3 4 5 |
|
Make sure --ioapic
is on
Link local folder to cache apt-get packages
It is very annoying to wait when packages being downloaded. Here is how to do it only once.
Create method in header of your Vagrant file:
1 2 3 4 5 6 7 8 9 |
|
Use it inside configuration:
1 2 |
|
Create local virtual IP address:
1
|
|
Full source of Vagrant file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
World’s 1st Self-regulating Artificial Heart Transplanted in France
News
- World’s 1st self-regulating artificial heart transplanted in France it does not require outside control.
Dev
- Why your company shouldn’t use Git submodules interesting list of alternatives
#git
- EasyAI is a pure-Python artificial intelligence framework for two-players abstract games such as Tic Tac Toe, Connect 4, Reversi, etc. It makes it easy to define the mechanisms of a game, and play against the computer or solve the game
#Python
- iOS 7 Tech Talk Videos since iTunes Connect is on vacation…
#iOS
- Is REST losing its flair – REST API Alternatives
#web
Tech
- The Cubli: a cube that can jump up, balance, and ‘walk’ this is just awesome! It can balance on one corner! Link for more details
- Automator workflow of the month: DIY security cam need to try
#osx
Unit Testing React.js With Jasmine and Karma
I have been mentioning React.js several times before. Recently I had opportunity to play with it closely.
I also wanted to make it right from the beginning. I wanted to Unit tests.
My choice of framework is Jasmine
Quick search for working example gave only this
ReactTestUtils has tools for dispatching events to React components for testing (like ReactTestUtils.Simulate.click(component)). Unfortunately it’s not currently bundled with React in a way that’s easy to use. There’s an issue open (https://github.com/facebook/react/issues/560) for making this better. Right now probably the easiest way to get ReactTestUtils in a build is to clone the repo, add it to ReactWithAddons.js (add a require(‘ReactTestUtils’) at the top then add it to the object at the bottom), and do a build locally using grunt. Sorry this is a bit hard right now. Making the testing situation better is one of the priorities for upcoming React releases. :)
Not much…
Here what I did to make unit tests work for React.js:
Setup:
Make Changes to Rect.js to include testing utilities:
clone https://github.com/facebook/react.git
;- Change react/src/ReactWithAddons.js to add
ReactTestUtils
:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
- to access ReactTestUtils we will need to use
React.addons.ReactTestUtils
. This part was not so obvious to me; run ‘grunt build’; - and take ‘build/react-with-addons.js’. We will use this file instead react.js during testing.
Code to Test:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Tests:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
We even can use JXS syntax inside tests: <Label>Some Text We Need for Test</Label>
.
Make everything work together under Grunt
- Pre-process JSX files before running tests (grunt task):
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
- run karma tests:
1 2 3 4 5 6 |
|
And now we have project which allows us to do proper unit testing for React.js applications
Full souce code could be found here
All iOS Application Should Be Built With SDK 7 Form February 1
News
- All iOS application should be built with SDK 7 form February 1 just build. I hope they will not require UI changes…
#ios
Dev
- A basic guide to when and how to deploy HTTPS nice and simple explanation. Very good if someone asks why and when we need HTTPS
- The Future of JavaScript MVC Frameworks virtual DOM is our answer
#JavaScript
- Extreme Programming, a Reflection teams who consistently work overtime are failing.
- Free Responsive Web Templates – 60+ HTML5 CSS Templates
- By your _cmd must read to understand how iOS works inside
#ios
- Drag & Drop: Think Twice I also don’t like it for mobile applications
#ios
- Introduction to Core Bluetooth: Building a Heart Rate Monitor
#ios
- Privacy in mobile apps this is just all you need to know about personal data + it has links to laws
- What is App Store Optimisation? as always — make good application is not enough
#ios
Science
- World of Mathematics best website I ever saw! But some sections are still under development.
Tech
Startup
300ms Tap Delay, Gone Away
News
- 300ms tap delay, gone away Chrome 32 does not have tap delay for mobile optimized sites
#JavaScript
Dev
- Reddit’s empire is founded on a flawed algorithm may be we need to adopt it…
- XCPretty Flexible and fast xcodebuild formatter
#xcode
- Transplanting Constraints Suggestions to edit xib XML directly as text file. May be we need to make it properly in runtime?
#ios
- TWMessageBarManager An iOS manager for presenting system-wide notifications via a dropdown message bar.
#ios
- FastCoding FastCoder is a high-performance binary serialization format for Cocoa objects and object graphs. It is intended as a replacement for NSPropertyList, NSJSONSerializer, NSKeyedArchiver/Unarchiver and Core Data.
#ios
- Mensa: Smart Tables Shows three simple techniques for modern UITableViews. The three techniques are each separate in concept but are combined in this demo project; you can use each independently. I’m still not sure if it is useful
#ios
- APIClient
Science
Startup
Google Bought Boston Dynamics
News
- Google Bought Boston Dynamics they are building army!
Dev
- UI Designer plugin for AppCode is available in early preview I always used AppCode for non UI code.
#ios
- Animate in xCode Without Code A simple library that gets things moving. It simplifies animation of UI elements
#ios
- ReactiveCocoa Essentials: Understanding and Using RACCommand good explanation of core of ReactiveCocoa. Concept is very close to React.js from Facebook
#ios
- CAGradientLayer Animated progress view
#ios
- Touch Gesture Icons nice set of ready to use icons. For FREE
#ios
- Objective-C: What Does The “.m” Extension Stand For
#ios
- Development and Deployment at Facebook good paper on development processes in Facebook (they don’t have QA team!)
Disqus Cracked - Security Flaw Reveals User E-mail Addresses
News
- Disqus cracked – security flaw reveals user e-mail addresses and i was just going to install it on my website…
Dev
- Telegraphy Telegraphy provides real time events for WSGI Python applications with additional features such as event filtering, subscription persistence and authorization/authentication. It’s initially intended for Django but you can extend it to any WSGI framework.
#Python
- Server-generated JavaScript Responses I feel we are moving back to JSP…
#JavaScript
- websocketd Turn any application that uses STDIO/STDOUT into a WebSocket server. Just need to figure out security implications for this. But might me good for orchestration.
Science
- The Sad Story of the Battery Breakthrough that Proved Too Good to Be True just test it properly!
Misc
Debugging a Live Saturn V
Dev
- SDCAlertView reimplementation of UIAlertView. I also had issues when moving to iOS 7. So this might be a solution…
#ios
- Understanding Frame must read to understand coordinate manipulation in iOS
#ios
- To Annotate App Store Screenshots or Not apple put screenshot against own guidelines
#ios
- A Programmer’s Guide to Data Mining free book on data analysis
- bamboo 0.6.3 bamboo is an application that systematizes realtime data analysis. bamboo provides an interface for merging, aggregating and adding algebraic calculations to dynamic datasets. Clients can interact with bamboo through a REST web interface and through Python
- Graph databases and Python nice review of Graph Databases and implementation with Python
#Python
Startup
- The cost of getting a new mobile gamer exceeds revenue that user generates this article compares average values. Good games still have a chance.
Science
- Debugging A Live Saturn V debugging circuits in fully loaded rocket!
- Free Mathematics Books huge list
Chrome and Opera Optimize for Mozilla-Pioneered Asm.js
News
- Chrome and Opera Optimize for Mozilla-Pioneered Asm.js soon all games will be inside browsers too
Dev
- Introduction to React.js I start to like it more and more…
#JavaScript
- SimPholders 1.5 A small utility for fast access to your iPhone Simulator apps. Opens folder in Finder, resets library and documents, and deletes the selected app.
#ios
- lookback.io record user actions to analyze what actual users do. It records movies. So sometimes is too big. It is free for now…
#ios
- Developing for the M7 how to work with motion detection chip in iPhone 5s
#ios
Tech
- Case with airbags when it will be built in to hones?
- BayesDB lets users query the probable implications of their data as easily as a SQL database lets them query the data itself. Definitely need to play with it!
- How the Bitcoin protocol actually works very nice and detailed explanation. Is it our future?
- Wood Excavator excellent wood engineering
- Paper Plane With Motor give me two!
Science
- Digital Taste Interface we learned how to full eyes
Startup
- Five Years in the App Store story of indie developer
If Java Is Dying, It Sure Looks Awfully Healthy
Dev
- If Java Is Dying, It Sure Looks Awfully Healthy
- DropzoneJS is an open source library that provides drag’n’drop file uploads with image previews
- {ggplot} Graph library for Python
- Tango With Django A beginner’s guide to web development with Django
- Snap.svg The JavaScript SVG library for the modern web.
- A lot of resources about Sprite Kit from iOS
- FastImageCache is an efficient, persistent, and—above all—fast way to store and retrieve images in your iOS application. Open sourced from Path
- FBSnapshotTestCase A “snapshot test case” takes a configured UIView or CALayer and uses the renderInContext: method to get an image snapshot of its contents. It compares this snapshot to a “reference image” stored in your source code repository and fails the test if the two images don’t match.
- Apportable write Android application in Objective C
Science
- PredictionIO is an open source machine learning server for software developers to create predictive features, such as personalization, recommendation and content discovery.
- Aerospace Company Develops Drone That Can Fly Continuously For 5 Years
Tech
- Reverse Microwave Chills Beer In 45 Seconds give me 2!