Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Eat, Sleep, Code, Repeat.

Rubanraj rubanraj54

:octocat:
Eat, Sleep, Code, Repeat.
  • Chronext
  • Cologne, Germany
View GitHub Profile
View postSalesDataFileToEmarsys.php
/**
* @param string $fileName
* @throws Exception
*/
private function postSalesDataFileToEmarsys(string $fileName): void
{
$cfile = new \CURLFile("/srv/www/app/sales_items_2020-05-26 13:50:11.csv", 'text/csv');
$ch = curl_init();
$options = array(
@rubanraj54
rubanraj54 / index.js
Created Mar 12, 2020 — forked from svaj/index.js
product sync-actions external image example
View index.js
import { createSyncProducts } from '@commercetools/sync-actions'
import {cloneDeep} from 'lodash'
const syncProducts = createSyncProducts()
const before = {
"id": "4e7ccbb5-0d06-48a8-8ff1-2b17b4bee189",
"version": 1,
View gist:8d2071f2ebe2c592e70aba63857b83e6
function match_wildcard( $wildcard_pattern, $haystack ) {
$regex = str_replace(
array("\*", "\?"), // wildcard chars
array('.*','.'), // regexp chars
preg_quote($wildcard_pattern)
);
return preg_match('/^'.$regex.'$/is', $haystack);
}
@rubanraj54
rubanraj54 / PaginationController.php
Created Apr 2, 2019 — forked from Repox/PaginationController.php
Laravel 5 Pagination with transform
View PaginationController.php
<?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Http\Request;
class PaginationController extends Controller
{
View App.vue
<template>
<div id="app">
<VueBootstrap4Table :payload="data" :table-config="config"></VueBootstrap4Table>
</div>
</template>
<script>
import VueBootstrap4Table from 'vue-bootstrap4-table'
export default {
@rubanraj54
rubanraj54 / gist:35ccd12688a487ae4dac84491e6ee2e9
Created Jul 3, 2018 — forked from Manu343726/gist:ca0ceb224ea789415387
Running ARM docker image with QEMU on x86_64 Arch Linux host
View gist:35ccd12688a487ae4dac84491e6ee2e9
# Install quemu, docker, etc
yaourt -S qemu qemu-user-static binfmt-support
# The quemu-user-static AUR package is outdated and broken. The .deb package they pull is no longer in the ubuntu repository.
# Edit the PKGBUILD and use qemu-user-static_2.4+dfsg-3_amd64.deb (With SHA1 sum "84d83a16c60c82b6c579f2f750b04a3ac26c249b")
# Enable ARM emulation
update-binfmts --enable qemu-arm
@rubanraj54
rubanraj54 / docker-compose.yml
Created Jan 13, 2018
Simple MongoDB cluster using docker compose (3 node cluster)
View docker-compose.yml
version: '3'
services:
node1:
image: mongo
ports:
- 30001:27071
volumes:
- $HOME/mongoclusterdata/node1:/data/db
networks:
@rubanraj54
rubanraj54 / zsh.md
Created Dec 12, 2017 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
View zsh.md

Prereq:

apt-get install zsh
apt-get install git-core

Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
@rubanraj54
rubanraj54 / docker-compose.yml
Created Oct 13, 2017
Orientdb cluster mode docker compose file
View docker-compose.yml
version: '3'
services:
instance1:
image: orientdb
ports:
- 2424:2424
- 2480:2480
volumes:
- $HOME/orientdb/databases1:/orientdb/databases
@rubanraj54
rubanraj54 / docker-compose.yml
Created Oct 6, 2017
Neo4j Community edition docker compose file Raw
View docker-compose.yml
version: '3'
services:
neo4j-community-1:
image: neo4j:3.2.3
ports:
- 9998:7474
- 7778:7687
volumes:
- ~/neo4j/data:/data