Skip to content

Instantly share code, notes, and snippets.

View joseph-montanez's full-sized avatar

Joseph Montanez joseph-montanez

View GitHub Profile
var zoomInOutComp = node.addComponent({
onUpdate: function (time) {
// console.trace();
if (_SceneTwo.paused) {
//-- The scene us paused
trans.pause();
} else {
//-- The scene is not pause
if (trans.isPaused()) {
//-- the scene was unpaused, so we should
@joseph-montanez
joseph-montanez / PhysicEngine-pausing.js
Created October 11, 2015 14:40
How I am pausing the physics engine
function pause() {
FamousEngine.renderLoop.stop();
_SceneTwo.paused = true;
}
function resume() {
FamousEngine.renderLoop.start();
_SceneTwo.paused = false;
}
var node = parentNode.addChild();
function nextTrans(trans) {
var scale = [1,1,1];
if (node.getScale()[0] == 1) {
scale = [0.2, 0.2, 0.2];
}
trans.to([Math.random() * 10, Math.random() * 10, scale[0], scale[1], scale[2]], 'inOutQuad', 1500, function () {
nextTrans(trans);
});
@joseph-montanez
joseph-montanez / php.ini
Created August 15, 2014 19:58
Windows PHP Configuration
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@joseph-montanez
joseph-montanez / errors.log
Created February 6, 2014 06:05
Get the type of a some generic?
main.fs: error FS0001: This expression was expected to have type
'a
but here has type
'b option
<?php
class RegisterController extends BaseController {
/**
* Setup the registration view
* @return Illuminate\View\View
*/
public function showRegister() {
return View::make('user.register');
@joseph-montanez
joseph-montanez / ViewController.h
Created September 9, 2013 04:19
Accessing thenDate Crashes... 'NSInvalidArgumentException', reason: '-[__NSCFString timeIntervalSinceReferenceDate]: unrecognized selector sent to instance 0x7659160'
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@property (nonatomic) NSDate* thenDate;
@property (nonatomic) NSDate* nowDate;
@property (retain, nonatomic) IBOutlet UILabel *theTimer;
@property (retain, nonatomic) IBOutlet UILabel *theLabel;
-(void) updateTimer:(id) sender;
@end
@joseph-montanez
joseph-montanez / Main.hs
Created August 12, 2013 05:10
compiles but does nothing?
data GameState = Running | Paused | Stopped
data World = World {
gameState :: GameState,
loopCount :: Int
}
gameloop world =
case gameState world of
Running -> do
@joseph-montanez
joseph-montanez / output.txt
Last active December 20, 2015 18:19
get the same label from different types of records
Mechanical Pencil's diametric rating: 1.500000
Black Pen's diametric rating: 2.000000
@joseph-montanez
joseph-montanez / error.txt
Created August 6, 2013 23:57
get a parameter regardless of record type?
food.fs(25,25): error FS0001: This expression was expected to have type
fruit
but here has type
vegie