For the scenario, imagine posts has a foreign key user_id referencing users.id
public function up()
{
Schema::create('posts', function(Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('body');
/** | |
* Generate all the possible combinations among a set of nested arrays. | |
* | |
* @param array $data The entrypoint array container. | |
* @param array $all The final container (used internally). | |
* @param array $group The sub container (used internally). | |
* @param mixed $val The value to append (used internally). | |
* @param int $i The key index (used internally). | |
*/ | |
function generate_combinations(array $data, array &$all = array(), array $group = array(), $value = null, $i = 0) |
// Below one, runs the function when the DOM tree is built | |
$(document).ready(function({ | |
// Codes goes here | |
}); | |
$(function() { | |
// Codes goes here | |
}); | |
// Runs the funciton right away |
For the scenario, imagine posts has a foreign key user_id referencing users.id
public function up()
{
Schema::create('posts', function(Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('body');
<?php | |
/** | |
* Convert a comma separated file into an associated array. | |
* The first row should contain the array keys. | |
* | |
* Example: | |
* | |
* @param string $filename Path to the CSV file | |
* @param string $delimiter The separator used in the file | |
* @return array |
Assume that you are running stand alone Selenium server and you would like to run tests with Chrome browser intead of Firefox or anyother driver Here are the steps to do so
java -jar -Dwebdriver.chrome.driver=/Users/abc/chromedriver selenium-server-staalone-3.0.1.jar
function afterSubmit(scriptContext) { | |
// prepare headers | |
var headers = { | |
'Authorization': 'Bearer <your access token>', | |
'Content-Type': 'application/json', | |
'accept': '*/*' | |
}; | |
// prepare body, since I'm Updating a record in Salesforce, I'm using Http Method PUT | |
var body = { | |
"field1": "value1", |
<?php | |
// Use in the "Post-Receive URLs" section of your GitHub repo. | |
if ( $_POST['payload'] ) { | |
shell_exec( 'cd /srv/www/git-repo/ && git reset --hard HEAD && git pull' ); | |
} | |
?>hi |
@RestResource(urlMapping='/Netsuite/TBA/*') | |
global with sharing class NetSuiteTBATestWS { | |
@HttpGet | |
global static String doGet() { | |
OAuth10a oAuth = new OAuth10a(); | |
Http h = new Http(); | |
HttpRequest req = new HttpRequest(); | |
req.setMethod('GET'); |