Skip to content

Instantly share code, notes, and snippets.

View ClaudiuCreanga's full-sized avatar
💭
Hitting the gym

Claudiu Creanga ClaudiuCreanga

💭
Hitting the gym
View GitHub Profile
@ClaudiuCreanga
ClaudiuCreanga / bash
Last active August 10, 2018 10:19
docker commands
docker build -t dueto-reports .
docker run -it -d dueto-reports /bin/bash
docker run -v ~/Downloads/data/:/home -it -d dueto-reports
python -m tensorboard.main --logdir=04/logs
singularity run --bind $PWD/data:/data/db mongo.img --auth # run mongo db, instead of --auth insert port to prevent restriction
singularity run --bind /home/ccreanga/gatk,/illumina/sync/igenomes/Homo_sapiens/NCBI/GRCh38Decoy/Sequence/WholeGenomeFasta/:/home/ccreanga/gatk_data/data /illumina/development/singularity/gatk.simg
docker login docker-cgri.dockerhub.illumina.com
docker tag e4ae643c9055 docker-cgri.dockerhub.illumina.com/claudiu/gatk
docker push docker-cgri.dockerhub.illumina.com/claudiu/gatk
singularity pull docker://docker-cgri.dockerhub.illumina.com/claudiu/gatk
singularity shell /illumina/development/singularity/claudiu/gatk
singularity run --bind /home/ccreanga/singularity_test/:/home/ /illumina/development/singularity/dueto-reports.simg -d /home/build -i /home/demo_3.v2.sqlite
SELECT
files.repo_name,
REGEXP_EXTRACT(contents.content,r'(.*"php".*)') AS version
FROM
[bigquery-public-data:github_repos.contents] AS contents
JOIN (
SELECT
path,
repo_name,
id
@ClaudiuCreanga
ClaudiuCreanga / magento2 get list of stores.php
Created March 25, 2017 12:25
magento2 get list of stores
<?php
use Magento\Framework\App\Bootstrap;
require '../app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $_SERVER);
$obj = $bootstrap->getObjectManager();
$state = $obj->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');
use Magento\Framework\App\Bootstrap;
require __DIR__ . '/app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $_SERVER);
$obj = $bootstrap->getObjectManager();
$state = $obj->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');
<?php
use Magento\Framework\App\Bootstrap;
require __DIR__ . '/app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $_SERVER);
$obj = $bootstrap->getObjectManager();
$state = $obj->get('Magento\Framework\App\State');
setInterval() <-issues because sometimes it doesn’t finish before the next function starts. To solve it make setTimeout call itself:
(function(){
doStuff();
setTimeout(arguments.callee,100)
}()
arguments.callee to refer to the currently executing function
or better:
(function names(){
doStuff();
@ClaudiuCreanga
ClaudiuCreanga / php show errors
Created February 9, 2017 10:03
show errors in php
error_reporting(E_ALL);
ini_set('display_errors', 1);
// ----------------------------------------------------------------------------------------------------
// - Display Errors
// ----------------------------------------------------------------------------------------------------
ini_set('display_errors', 'On');
ini_set('html_errors', 0);
// ----------------------------------------------------------------------------------------------------
@ClaudiuCreanga
ClaudiuCreanga / magento1 layout snippets
Created February 9, 2017 09:42
magento1 layout snippets xml
==== remove title of the page ====
<cms_page translate="label">
<reference name="content">
<remove name="page_content_heading"/>
</reference>
</cms_page>
==== call title of cms pages ====
<?php
$prefix = Mage::getStoreConfig('design/head/title_prefix');