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
#container { | |
overflow: hidden; | |
width: 100%; | |
} | |
#left-col { | |
float: left; | |
width: 50%; | |
background-color: orange; | |
padding-bottom: 500em; | |
margin-bottom: -500em; |
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 | |
$my_URL="http://some-website.com/mydata.txt"; | |
$lines = file($my_URL); | |
foreach ($lines as $line_num => $line) | |
{ | |
echo $line_num." ".$line; | |
} | |
?> |
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
jQuery.fn.messagePlugin = function(){ | |
var selectedObjects = this; | |
return { | |
saySomething : function(message){ | |
$(selectedObjects).each(function(){ | |
$(this).html(message); | |
}); | |
return selectedObjects; // Preserve the jQuery chainability | |
}, | |
anotherAction : function(){ |
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
String.prototype.map_replace = function (values) { | |
var string = this, key; | |
for (key in values) { | |
string = string.replace(new RegExp('\\{' + key + '\\}', 'gm'), values[key]); | |
} | |
return string | |
} | |
//usage |
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
var input_string = document.getElementById('my-input').innerText; | |
var output_element = document.getElementById('my-output'); | |
//here we go | |
var right_text = input_string.substring(0, input_string.indexOf(":")); | |
output_element.innerText = right_text; |
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
//installs "packagename" latest version | |
composer require vendorname/packagename | |
//installs package version 1.2 | |
composer require vendorname/packagename 1.2 | |
//installs package version above 1.2 but lesser then 2.0 | |
composer require vendorname/packagename 1.2.* | |
//installs package version above 1.2 but lesser then 2.0 |
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
var theParentGO = GameObject.Find("ParentName"); | |
theParentGO.transform.GetComponentInChildren<ScriptOnTheChild>(true).gameObject; |
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
phonegap plugin add cordova-plugin-app-version --save | |
/* | |
'--save' command also saves the plugin in the config.xml | |
*/ |
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
void Start () | |
{ | |
StartCoroutine (LateStart()); | |
} | |
IEnumerator LateStart() | |
{ | |
yield return new WaitForEndOfFrame (); | |
// Do your magic here! |
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
/** | |
* find out if child is first level child of given GO | |
* @return Transform | |
**/ | |
bool IsFirstLevelChildOf(Transform root, Transform child) | |
{ | |
bool isFirstLevel = false; | |
var children = root.GetComponentsInChildren<Transform>(); | |
foreach(var c in children) { | |
if (c.parent == root && c == child) { |