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
// No DI | |
public class Car{ | |
private Motor motor; | |
public Car(){ | |
motor = new ElectricMotor(); | |
} | |
} |
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->University->Behaviors->load('Containable'); | |
$containArray = array( | |
'Course' => array( | |
'Group' => array( | |
'Studen' => array( | |
'Marks' | |
) | |
) | |
) |
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
(function($, window, undefined){ | |
var requests = {} | |
$.fn.loadContent = function(url, opts){ | |
/* | |
* | |
* Customization | |
* |
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
// Call from a Context(e.g. an Activity) | |
public void openTargetActivity(){ | |
startActivity(new Intent(this, TargetActivity.class)) | |
} |
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
(function(msg){ | |
console.log(msg); | |
})("42"); |
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
// Método para cambiar estilos a la última palabra | |
private Spannable highlightLastWordOfSentence(String sentence, int backgroundColor, int foregroundColor){ | |
int startIndexOfLastWord = sentence.lastIndexOf(" ") + 1; | |
int endIndexOfLastWord = sentence.length(); | |
SpannableStringBuilder spannable = new SpannableStringBuilder(sentence); | |
BackgroundColorSpan backgroundSpan = new BackgroundColorSpan(backgroundColor); | |
spannable.setSpan(backgroundSpan, startIndexOfLastWord, endIndexOfLastWord, Spannable.SPAN_INCLUSIVE_INCLUSIVE); | |
ForegroundColorSpan foregroundSpan = new ForegroundColorSpan(foregroundColor); |
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 | |
require_once(CORE_PATH . 'Cake/Model/ConnectionManager.php'); | |
class ExampleTestData extends CakeTestSuite { | |
public static function suite() { | |
self::loadDB(); | |
$suite = new CakeTestSuite('Name Of The Suite'); | |
$suite->addTestDirectory(TESTS . 'Case' . DS . 'Sample'); | |
return $suite; |
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
public class Calculator { | |
public static String[][] values = { | |
{ "CM", "DCD" }, | |
{ "M", "DD" }, | |
{ "CD", "CCCC" }, | |
{ "D", "CCCCC" }, | |
{ "XC", "LXL" }, |
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
# Montar unidad | |
fdisk -l # Listar unidades montables | |
mkdir /path/to/mount # Creamos carpeta donde vamos a montar unidad | |
mount -t [type] [/path/to/device] [/path/to/mount] # De la información de los dos comandos anteriores ya podemos montar |
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 | |
namespace App\Test\TestCase\Custom; | |
use Cake\TestSuite\TestCase; | |
class DemoTest extends TestCase { | |
public function testDemo(){ | |
$this->assertEquals(1, 1); | |
} |
OlderNewer