I suspect that some trig calculations could make this very general.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//mimic if statement for angular | |
//Schema: if(expression, 'foo', 'bar') | |
$scope['if'] = function(condition, a, b) { | |
return condition ? a : b; | |
}; | |
//mimic switch case for angular | |
//Schema: switch(colorid, [[1,'red'], [2,'green'], [3, 'blue']], 'black') | |
$scope['switch'] = function (expression, cases, thedefault) { | |
for(var i = 0; i < cases.length; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The Media Object | |
*/ | |
.media {margin:10px;} | |
.media, .bd {overflow:hidden; _overflow:visible; zoom:1;} | |
.media .img {float:left; margin-right: 10px;} | |
.media .img img{display:block;} | |
/* for element positioned on the right */ | |
.media .imgExt{float:right; margin-left: 10px;} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// RotarySwitch.pde -- test out a rotary switch (not a rotary encoder) | |
// Tod E. Kurt, http://todbot.com/blog/ | |
////4-position rotary switch | |
const int firstRotaryPin = 3; | |
const int lastRotaryPin = 7; | |
int button = 9; ////button input | |
int input1 = LOW; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="block"> | |
<div class="centered">Hello world</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
crunch.pubsub = _.extend({}, Backbone.Events); | |
// Hide backbone implementation by aliasing | |
crunch.pubsub.publish = crunch.pubsub.trigger; | |
crunch.pubsub.subscribe = crunch.pubsub.bind; | |
crunch.pubsub.unsubscribe = crunch.pubsub.unbind; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::-webkit-input-placeholder, | |
input:-moz-placeholder { | |
text-align:center; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* To prevent rubber band scrolling in Lion */ | |
body { | |
overflow:hidden; | |
height:100%; | |
} | |
/* Also look to add in -webkit-overflow-scrolling for touch iOS 5 < devices */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Boot up with OSX Disk. | |
Firstly try Disk Utility repair | |
Then if that does not work try (with the drive unmounted) | |
Open terminal and type: | |
/sbin/fsck_hfs -ypr /dev/disk0s2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Connect to your Mac's localhost from within a VMWare virtual machine. | |
- Boot up VMware and fire up your VM (i'm using Windows 7) | |
- Make sure that the VM is using NAT | |
- Fire up the command prompt in Windows and type "ipconfig". IN the resulting text look for your IPv4 address. It will be something like 192.168.xxx.xxx | |
- Now go to your browser in your VM and type that ip address into the url bar but change the last set of digits to be 2 (or 1). | |
- so as an example if your ip was found to be 192.168.213.200 change it to be 192.168.213.2 | |
- Assuming that your localhost is running on your mac you should get your localhost in your VM browser. | |
- If you need to add a non standard port number on the end like 8090 go ahead and do so. |