Skip to content

Instantly share code, notes, and snippets.

View firecentaur's full-sized avatar
🏠
Working from home

Paul Preibisch firecentaur

🏠
Working from home
View GitHub Profile
@firecentaur
firecentaur / app.init.js
Created November 10, 2017 10:56
MockRouter
/**
* gets and returns static json mocks
* @param jsonFilePath
* @returns {[null,null,null]}
*/
function getData(jsonFilePath) {
var request = new XMLHttpRequest();
request.open('GET', jsonFilePath, false);
request.send(null);
{"group":{"type":"user","visibility":"public","originalprofilepicname":"","originalbannerpicname":"","name":"Dummy_Group_7NZIL4mdzn","publish":"published","uid":0,"description":"Test group description","create_time":{"expression":"NOW()","params":[]},"update_time":{"expression":"NOW()","params":[]},"id":"391","profilepic":null,"banner":null,"status":null},"folders":[{"parent_type":"Group","visibility":"public","name":"Dummy_Folder1_w33Cuop5uj","publish":"published","description":null,"parentid":391,"type":null,"uid":0,"create_time":{"expression":"NOW()","params":[]},"update_time":{"expression":"NOW()","params":[]},"id":"1506","status":null,"pic":null},{"parent_type":"Group","visibility":"public","name":"Dummy_Folder2_vaQDXx9d8p","publish":"published","description":null,"parentid":391,"type":null,"uid":0,"create_time":{"expression":"NOW()","params":[]},"update_time":{"expression":"NOW()","params":[]},"id":"1507","status":null,"pic":null},{"parent_type":"Folder","visibility":"public","name":"Dummy_Folder3_AgdzZ
cookbook_file '/srv/www/{application}/current/master/gulpfile.js' do
source 'gulpfile.js'
owner 'ubuntu'
group 'ubuntu'
mode '0755'
action :create
end
#delete node_modules folder first
node[:deploy].each do |application, deploy|
backendLocation = application.sub('frontend','backend');
cookbook_file "/srv/www/#{application}/current/master/gulpfile.js" do
source 'gulpfile.js'
owner 'ubuntu'
group 'ubuntu'
mode '0755'
action :create
end
node[:deploy].each do |application, deploy|
next unless application.match('frontend')
backendLocation = application.sub('frontend', 'backend')
log 'message' do
message 'backendLocation is #{backendLocation}'
level :info
end
execute 'run tagindex delete' do
command 'php yiic tagIndex delete'
@firecentaur
firecentaur / backend_ashish.bash
Created May 8, 2018 10:34
Sample Backend Build script in the backend_ashish jenkins build job
sudo sh ~/bin/initdb_localhost.sh root elastrix ashish
#this file is used by the jenkins.movieenglish.jp build execution step
branchName=ashish
buildfolder='backend_'$(date +"%m%d%Y")'_'$(date +%s);
www=/srv/www/$branchName
jobname=$branchName'_'backend
linkname=backend
buildfolder=$linkname'_'$(date +"%m%d%Y")'_'$(date +%s)
cd $www
cd $WORKSPACE;
cd build/
chmod 777 deployFrontendForTestTeam.sh
./deployFrontendForTestTeam.sh ashish ashish_frontend
<?php
/**
* Copyright (c) 2018. Movie English Project
* Unauthorized copying of this file, via any medium is strictly prohibited
* Proprietary and confidential
* Written by Navya Devadiga <devadiga.navya@gmail.com>
*/
class ChannelManagerController extends Controller
{
public function testMultipleChange1(){
$video1 = $this->testCase->createTestVideo(9, 'Group');
$video2 = $this->testCase->createTestVideo(9, 'Group');
$video3 = $this->testCase->createTestVideo(9, 'Group');
$multipleUpdate = 'UPDATE video SET order = CASE id ';
$arr=[];
$arr[]=$video1;
$arr[]=$video2;
$arr[]=$video3;
<?php
/**
* Copyright (c) 2017. Movie English Project
* Unauthorized copying of this file, via any medium is strictly prohibited
* Proprietary and confidential
* Paul Preibisch <fire@b3dmultitech.com>
*/
$videoIndex = strtolower('stablejpvideoindex');
$tagIndex = strtolower('stablejptagindex');