Skip to content

Instantly share code, notes, and snippets.

View igodorogea's full-sized avatar

Ivan igodorogea

  • Chisinau, Moldova
View GitHub Profile
@igodorogea
igodorogea / 10-init-ubuntu.sh
Last active December 8, 2017 18:30
Setup Ubuntu for TYPO3
#!/bin/bash
sudo apt update -y
sudo apt upgrade -y
sudo apt install zsh git-core
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
sudo chsh -s $(which zsh) ubuntu
sudo apt install -y nginx
@igodorogea
igodorogea / nice-scale.js
Created January 11, 2017 23:16
Javascript - Algorithm for Optimal Scaling on a Chart Axis (Nice Numbers for Graph Labels)
function NiceScale (lowerBound, upperBound, _maxTicks) {
var maxTicks = _maxTicks || 10;
var tickSpacing;
var range;
var niceLowerBound;
var niceUpperBound;
calculate();
@igodorogea
igodorogea / embed.bat
Created November 22, 2016 09:44
Replace jetbrains terminal with babun
@echo off
C:\Users\<user>\.babun\cygwin\bin\env.exe CHERE_INVOKING=1 /bin/zsh -
@igodorogea
igodorogea / server.js
Last active October 19, 2019 05:06
BrowserSync middleware - proxy on the same context, redirect only if 404 from local server
'use strict';
var path = require('path');
var gulp = require('gulp');
var conf = require('./conf');
var fs = require('fs');
var url = require("url");
var browserSync = require('browser-sync');
var browserSyncSpa = require('browser-sync-spa');
@igodorogea
igodorogea / signature.html
Last active June 16, 2016 14:41
MUUME signature
<style type="text/css">
/* Client-specific Styles */
#outlook a {padding:0;} /* Force Outlook to provide a "view in browser" menu link. */
body{-webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; margin-top: 15px; margin-left: 10px; margin-bottom: 30px; margin-right: 10px; padding:0;}
/* Prevent Webkit and Windows Mobile platforms from changing default font sizes, while not breaking desktop design. */
.ExternalClass {width:100%;} /* Force Hotmail to display emails at full width */
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;} /* Force Hotmail to display normal line spacing. */
body .signature-container { margin: 0px 0px !important; margin-top: 10px !important; }
.signature-container a:link {color:#F17E29; text-decoration:underline;}
@igodorogea
igodorogea / TYPO3 Extension - Hook - Flexform Manipulaltion - T3libBefunc.php This is a Hook which is responsible for flexform manipulations depending on the chosen controller action (switchableControllerAction). Following Hook file is located in typo3conf/ext/your_ext/Classes/Hooks/T3libBefunc.php You need to register this Hook within your ext_localconf: $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc…
<?php
/***************************************************************
* Copyright notice
*
* (c) 2012-2013 Andy Hausmann <[email protected]>, sota studio
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@igodorogea
igodorogea / deb-init.sh
Last active April 27, 2016 10:16
Debian Jessie php development environment
#!/bin/bash
function say {
printf "\n--------------------------------------------------------\n"
printf "\t$1"
printf "\n--------------------------------------------------------\n"
}
say "Prepare machine..."
$($0).find('path').each(function(idx, path) {
var coords = $(path)
.attr('d')
.split(' ')
.filter(function(el) {
return /^(M|L)/.test(el);
})
.map(function(el) {
return el.replace(/^(M|L)/, '').split(',');
});
# Based on https://gist.github.com/fernandoaleman/5083680
# Start the old vagrant
$ vagrant init ubuntu_saucy
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
@igodorogea
igodorogea / Vagrantfile
Created October 25, 2015 11:02 — forked from Jakobud/Vagrantfile
Vagrant Windows 260 character path limit workaround
# If you are using Windows as your Vagrant host OS, there is a limitation in Windows where any given folder path
# cannot be more than 260 characters long. This becomes a problem with Vagrant because, for example, if you
# install a Linux guest environment and try to create a deep directory structure in a synced folder, Linux will
# throw errors. This is because the synced folder is under the constraints of the Windows host. A common example
# of this happening is when installing node.js modules. NPM is known for creating some very long, deep
# folder paths because each node depenency has it's own dependencies, which have their own dependencies, etc...
#
# This gist solves the problem and works around the Windows 260 character path limit. Add it to your Vagrantfile.
#
# NOTE: This bug in Vagrant was fixed in 1.7.3, but reverted back in 1.7.4 due to some regression bugs.