Skip to content

Instantly share code, notes, and snippets.

View acip's full-sized avatar

Ciprian Amariei acip

View GitHub Profile
@acip
acip / baas-options.md
Created October 28, 2015 13:30
Backend as a Service (BaaS) options
@acip
acip / configuration.md
Created May 21, 2018 08:01
Optimze Laravel speed in Docker for Windows/MacOS using opcache.

Add to your Dockerfile:

RUN docker-php-ext-configure opcache --enable-opcache \
    && docker-php-ext-install opcache
ADD php-config/opcache.ini /usr/local/etc/php/conf.d/opcache.ini
ADD php-config/opcache-blacklist.txt /usr/local/etc/opcache-blacklist.txt

Create php-config/opcache.ini with this content:

opcache.memory_consumption=128
@acip
acip / Git post-checkout Laravel clear or renew caches
Created December 10, 2018 09:20
Git post-checkout hook to refresh caches for Laravel projects
#!/bin/bash
echo -e "\e[1m\e[94mpost checkout: renew Laravel caches.\e[0m"
php artisan cache:clear
php artisan config:cache
php artisan route:cache
php artisan view:clear
@acip
acip / usdron.json
Last active May 16, 2019 06:51
usdron
{"usd": 4.23}
@acip
acip / AndroidManifest.xml
Created September 26, 2019 11:38
Fix for flutter image_cropper Unable to find explicit activity class {.../com.yalantis.ucrop.UCropActivity};
<!-- Just add this activity -->
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
@acip
acip / animate.html
Created November 21, 2019 18:39
setTimeout vs requestAnimationFrame
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<img id="stimImg" style="position:absolute; top:100px; left:100px; display:none" width="300" height="300" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAAAXNSR0IArs4c6QAAGgVJREFUeAHtnQm4XVV1x3fmeZ5HkkAgCRkYBQrKYJFAEQlEQaAyiNhatMXaVqjaVlNjrdoWQUTAMoiCIAioUcQQlTKoBJOQBEJMXuZ5nhMCXevCzTu5b+9z791v2Fm83/q+9737zj377HV/e9//28M667QYOuXZNx0GAQhAwACBlgZ8xEUIQAACBQIIFh0BAhAwQwDBMtNUOAoBCCBY9AEIQMAMAQTLTFPhKAQggGDRByAAATMEECwzTYWjEIAAgkUfgAAEzBBAsMw0FY5CAAIIFn0AAhAwQwDBMtNUOAoBCCBY9AEIQMAMAQTLTFPhKAQggGDRByAAATMEECwzTYWjEIAAgkUfgAAEzBBAsMw0FY5CAAIIFn0AAhAwQwDBMtNUOAoBCCBY9AEIQMAMAQTLTFPhKAQggGDRByAAATMEECwzTYWjEIAAgkUfgAAEzBBAsMw0FY5CAAIIFn0AAhAwQwDBMtNUOAoBCCBY9AEIQMAMAQTLTFPhKAQggGDRByAAATMEECwzTYWjEIAAgkUfgAAEzBBAsMw0FY5CAAIIFn0AAhAwQwDBMtNUOAoBCCBY9AEIQMAMAQ
@acip
acip / fitTextElementsGroup.js
Last active April 16, 2020 07:20
Fit the text into element by adjusting the font size across multiple elements. In action here https://repl.it/repls/CumbersomeVisibleSpellchecker
const buttons = document.querySelectorAll('button');
fitTextToElementsGroup(buttons);
function fitTextToElementsGroup(elements) {
const arrElements = elements.map ? elements : Array.apply(null, elements);
const fontSizes = arrElements.map(computeMaxFontSize);
const minFontSize = Math.min.apply(Math, fontSizes);
applyFontSizePx(buttons, minFontSize);
@acip
acip / is this you?.md
Last active March 2, 2021 15:46
Junior Full-stack Web Developer @ Testable

The times demand more from us, here at Testable. We need some fresh reinforcement in the form of a junior full-stack web developer (who aims for ninja level).

If you are passionate about web development and want to expand your knowledge and you are not afraid to get your hands dirty right away (we don't do "artificial" projects), if you like to be independent, but also get the right guidance, we offer you the ideal context to grow. We are a seasoned team of varied personalities and we believe in knowledge sharing as one of the team's superpowers.

You will be working on our main products at Testable. Our stack relies on PHP (Laravel) on the server-side and plain JavaScript or VueJS on the front end. You don't need to have professional experience, but we'd love to see some work you've done using PHP and/or JavaScript. Knowledge about how WWW works and its main protocols is paramount. We are looking for someone who is a flexible team player, with a "**get-it-don

@acip
acip / accessibility-check.js
Last active November 26, 2020 13:50
Run an accessibility test and generate report with Puppeteer and Accessibility Developer Tools - https://github.com/GoogleChrome/accessibility-developer-tools.
const puppeteer = require('puppeteer');
const fs = require('fs');
(async () => {
const browser = await puppeteer.launch({
userDataDir: './myUserDataDir',
dumpio: true,
});
const page = await browser.newPage();
await page.goto('https://google.com');
@acip
acip / local-time.html
Created August 18, 2021 15:59
Display UTC time in local time with JavaScript without dependencies.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Local time</title>
</head>
<body>
Local time for 2011-10-10T14:48:00Z is: <time datetime="2011-10-10T14:48:00Z" data-format="hh:mm:ss A"></time>