Skip to content

Instantly share code, notes, and snippets.

View iamandrewluca's full-sized avatar
🚨
Git Inspector

Andrei Luca iamandrewluca

🚨
Git Inspector
View GitHub Profile
@jkulak
jkulak / git loglive
Created November 22, 2016 23:08
Display git log live
#!/bin/bash
while :
do
clear
git --no-pager log --oneline --decorate --all --graph --date=relative $*
sleep 2
done
@dbu
dbu / SynchronizeTranslationsCommand.php
Created December 5, 2012 17:21
Xliff translation updated
<?php
namespace Liip\CoreBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Translation\Loader\LoaderInterface;
use Symfony\Component\Finder\Finder;
@vijayrami
vijayrami / How To disable Page Configuration tab in typo3 backend
Created December 3, 2015 12:40
How To disable Page Configuration tab in typo3 backend
Add Below Code in your Page Typoscript Configuration.
# For Not Displaying page Configuration tab
TCEFORM.pages.tx_fed_page_flexform {
# You cannot edit the Page Configuration field now:
disabled = 1
}
TCEFORM.pages.tx_fed_page_flexform_sub {
# You cannot edit the Page Page Configuration - subpages field now:
disabled = 1
@peggyrayzis
peggyrayzis / .babelrc
Last active February 7, 2019 03:31
Webpack 2 + PWA support (Tree Shaking, Code Splitting w/ React Router v4, Service Worker)
{
"presets": [
"react",
"stage-2",
[
"env",
{
"targets": {
"browsers": [
"last 2 versions",
@cmrigney
cmrigney / useRedux.ts
Created April 11, 2019 18:05
Example for useRedux
// Adapted code from https://github.com/flepretre/use-redux
import { useContext, useState, useEffect, useCallback } from 'react';
import { ReactReduxContext } from 'react-redux';
import { bindActionCreators, ActionCreator } from 'redux';
export function useRedux() {
const { store } = useContext(ReactReduxContext);
const { getState, dispatch, subscribe } = store;
const reduxState = getState();
@kitze
kitze / missing-date-fns.js
Last active June 21, 2020 19:56
good ol' date-fns
import {
formatDistance,
isAfter,
isBefore,
endOfDay,
startOfDay,
isSameDay,
isSameSecond,
isSameMinute,
isSameHour,
angular.module('qAllSettled', []).config(function($provide) {
$provide.decorator('$q', function($delegate) {
var $q = $delegate;
$q.allSettled = function(promises) {
return $q.all(promises.map(function(promise) {
return promise.then(function(value) {
return { state: 'fulfilled', value: value };
}, function(reason) {
return { state: 'rejected', reason: reason };
});
@mhairston
mhairston / event-delegate.js
Created October 27, 2016 17:59
Event Delegation with Plain JavaScript
// Event Delegation with Plain Javascript
// from Adam Beres-Deak
// http://bdadam.com/blog/plain-javascript-event-delegation.html
function on(elSelector, eventName, selector, fn) {
var element = document.querySelector(elSelector);
element.addEventListener(eventName, function(event) {
var possibleTargets = element.querySelectorAll(selector);
var target = event.target;
@DavidWells
DavidWells / persist-page-views.js
Created October 10, 2021 01:21
Example of persisting page views via analytics package
import Analytics from 'analytics'
import onRouteChange from '@analytics/router-utils'
const persistPageViewsPlugin = {
name: 'persist-page-data-plugin',
page: ({ payload }) => {
const { properties } = payload
const pageView = {
path: properties.path,
title: properties.title,
@erikras
erikras / 00-ReduxFormDocsDeploy.md
Last active October 19, 2021 07:03
Redux Form Docs Deploy

Directory structure