Skip to content

Instantly share code, notes, and snippets.

@rolldone
rolldone / AddFulltextIndexesCommand.php
Created January 12, 2022 23:56 — forked from yobud/AddFulltextIndexesCommand.php
MATCH AGAINST for Doctrine DQL queries
<?php
# xxx/yyyBundle/Command/AddFulltextIndexesCommand.php
/**
* AddFulltextIndexesCommand.php
*
* @author Jérémy Hubert <jeremy.hubert@infogroom.fr>
* @since lun. 26 sept. 2011 09:23:53
*/
namespace xxx\yyyBundle\Command;
@rolldone
rolldone / test_functions.php
Created January 7, 2022 20:38 — forked from is-just-me/test_functions.php
Create combinations,products and update stock with Prestashop WEBSERVICE
<?php
function add_combination($data){
global $webService, $config;
try{
$xml = $webService->get(array('url' => $config["ps_shop"].'api/combinations?schema=blank'));
$combination = $xml->children()->children();
$combination->associations->product_option_values->product_option_values[0]->id = $data["option_id"];
$combination->reference = $data["code"];
$combination->id_product = $data["id_product"];
@rolldone
rolldone / updateNpm.bat
Created August 27, 2021 22:24 — forked from nokidding/updateNpm.bat
Windows batch file which updates npm for nvm-windows
rem see https://github.com/coreybutler/nvm-windows/issues/300
@echo off
SETLOCAL EnableDelayedExpansion
if [%1] == [] (
echo Pass in the version you would like to install, or "latest" to install the latest npm version.
) else (
set wanted_version=%1
@rolldone
rolldone / ImageController.js
Created April 16, 2021 12:22 — forked from nesimtunc/ImageController.js
Minio Server - NodeJS - File Upload & Photo Showing Example
const formidable = require('formidable');
const fs = require('fs');
var Minio = require('minio');
let minioClient = new Minio.Client({
endPoint: config.MINIO.ENDPOINT,
port: config.MINIO.PORT,
accessKey: config.MINIO.ACCESS_KEY,

Why I hate TypeScript

Warning: These views are highly oppinated and might have some slightly incorrect facts. My experience with typescript was about 2 weeks in Node and a week in angular2.

Not Standard

TypeScript is implementing their own take on JavaScript. Some of the things they are writing will likely never make it in an official ES* spec either.

Technologies that have competing spec / community driven development have a history of failing; take: Flash, SilverLight, CoffeeScript, the list goes on. If you have a large code base, picking TypeScript is something your going to be living with for a long time. I can take a bet in 3 years JavaScript will still be around without a doubt.

Its also worth noting that they have built some things like module system and as soon as the spec came out they ditched it and started using that. Have fun updating!

@rolldone
rolldone / docker-php-ext-install.md
Created August 26, 2020 09:13 — forked from giansalex/docker-php-ext-install.md
docker-php-ext-install Reference
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 
@rolldone
rolldone / Dockerfile
Created August 24, 2020 03:06 — forked from shov/Dockerfile
Docker PHP 7.2 fpm with GD jpg, png suppot
FROM php:7.2-fpm
# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# make sure apt is up to date
RUN apt-get update --fix-missing
RUN apt-get install -y curl
RUN apt-get install -y build-essential libssl-dev zlib1g-dev libpng-dev libjpeg-dev libfreetype6-dev
@rolldone
rolldone / readme.md
Created March 22, 2020 11:21 — forked from benstr/readme.md
Gist Markdown Cheatsheet

#Heading 1 ##Heading 2 ###Heading 3 ####Heading 4 #####Heading 5 ######Heading 6


Paragraph

@rolldone
rolldone / Function.Array-Group-By.php
Created March 17, 2020 04:13 — forked from mcaskill/Function.Array-Group-By.php
PHP : Groups an array by a given key
<?php
if (!function_exists('array_group_by')) {
/**
* Groups an array by a given key.
*
* Groups an array into arrays by a given key, or set of keys, shared between all array members.
*
* Based on {@author Jake Zatecky}'s {@link https://github.com/jakezatecky/array_group_by array_group_by()} function.
* This variant allows $key to be closures.
@rolldone
rolldone / 0_reuse_code.js
Last active August 29, 2015 14:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console