This file contains 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
import opencv | |
#this is important for capturing/displaying images | |
from opencv import highgui | |
import pygame | |
import sys | |
camera = highgui.cvCreateCameraCapture(0) | |
def get_image(): | |
im = highgui.cvQueryFrame(camera) | |
# Add the line below if you need it (Ubuntu 8.04+) |
This file contains 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
using UnityEngine; | |
using System.Collections; | |
public class CarControl : MonoBehaviour { | |
// NOTE: Companion script for wheel suspensions, attach to each wheel. | |
// https://gist.github.com/victorbstan/4dde0d0b4203c248423e | |
// PUBLIC | |
public bool driveable = false; |
This file contains 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
/** | |
* ============================================================================ | |
* MIT License | |
* | |
* Copyright (c) 2016 Eric Phillips | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a | |
* copy of this software and associated documentation files (the "Software"), | |
* to deal in the Software without restriction, including without limitation | |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
This file contains 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
private bool planesIntersectAtSinglePoint( Plane p0, Plane p1, Plane p2, out Vector3 intersectionPoint ) | |
{ | |
const float EPSILON = 1e-4f; | |
var det = Vector3.Dot( Vector3.Cross( p0.normal, p1.normal ), p2.normal ); | |
if( det < EPSILON ) | |
{ | |
intersectionPoint = Vector3.zero; | |
return false; | |
} |
This file contains 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
<!DOCTYPE html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>Validation</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
</head> | |
<body> | |
<div class="error"> | |
Please fill in all required field and submit the form again: | |
<ul> |
This file contains 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
<?php | |
/* | |
This function saved my life. | |
found on: http://www.sitepoint.com/forums//showthread.php?t=438748 | |
by: crvandyke | |
It takes an object, and when all else if/else/recursive functions fail to convert the object into an associative array, this one goes for the kill. Who would'a thunk it?! | |
*/ | |
$array = json_decode(json_encode($object), true); |
This file contains 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
<!-- | |
Usage examples | |
--> | |
<!-- IF ANY --> | |
{{#if any truthyOne truthyTwo falsyThree}} | |
You will see this. | |
{{/if}} | |
{{#if any falsyOne falsyTwo falsyThree}} |
This file contains 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
Begin Object Class=/Script/BlueprintGraph.K2Node_FunctionEntry Name="K2Node_FunctionEntry_0" | |
LocalVariables(0)=(VarName="ForLoopIndex",VarGuid=F6B85B124791C3A6C5AE9CB85E6F158F,VarType=(PinCategory="int"),FriendlyName="For Loop Index",Category=NSLOCTEXT("KismetSchema", "Default", "Default"),PropertyFlags=5,ReplicationCondition=COND_MAX) | |
SignatureClass=Class'"/Script/Engine.Actor"' | |
SignatureName="UserConstructionScript" | |
NodeGuid=6B3464D5426BBA94ED6D2CB353780E8A | |
CustomProperties Pin (PinId=FE0EFA894063EC185E9B7FA0908386F1,PinName="then",Direction="EGPD_Output",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsArray=False,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,LinkedTo=(K2Node_MacroInstance_0 0190FEC54CBF547DF6F3A596D323679F,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValu |
This file contains 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
using UnityEngine; | |
using System.Collections; | |
// ADD THIS SCRIPT TO EACH OF THE WHEEL MESHES / WHEEL MESH CONTAINER OBJECTS | |
public class Wheel : MonoBehaviour { | |
public WheelCollider wheelC; | |
private Vector3 wheelCCenter; | |
private RaycastHit hit; |
This file contains 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
$default_rounded_amount: 5px | |
// Round corner at position by amount. | |
@mixin round-corner($position, $amount: $default_rounded_amount) | |
border-#{$position}-radius: $amount | |
-webkit-border-#{$position}-radius: $amount | |
@mixin round-corner-mozilla($position, $amount: $default_rounded_amount) | |
-moz-border-radius-#{$position}: $amount | |
// Round left corners by amount |
NewerOlder