Skip to content

Instantly share code, notes, and snippets.

View RobinDev's full-sized avatar

Robin Delattre RobinDev

View GitHub Profile
@sebmellen
sebmellen / tailwind.config.js
Last active November 4, 2023 15:38
A tailwind.config.js file with the full color palette of Tailwind CSS 2.0, which I couldn't find available elsewhere. As of 2020-12-22, this config file works properly. Note that it will significantly increase the bundle size of your unpurged tailwind.css file!
// NOTE: AS REQUESTED, TAILWIND CSS 3.0 HAS FULL SUPPORT FOR ALL COLORS BY DEFAULT
// SEE https://tailwindcss.com/blog/tailwindcss-v3#every-color-out-of-the-box.
// As of 2020-12-22, this tailwind.config.js file includes all colors
// from the Tailwind CSS color palette reference laid out in full at this
// link: https://tailwindcss.com/docs/customizing-colors#color-palette-reference.
// Note that this will increase your unpurged Tailwind CSS file size immensely,
// for me it went from 3.64MB to 7.62MB! Be sure to purge your CSS in production!
// First we import the tailwindcss/colors dependency, as referenced
@bjo3rnf
bjo3rnf / webpack.config.js
Created August 14, 2019 16:31
Tailwind CSS in a Symfony Project with Webpack Encore and Purge CSS
const Encore = require('@symfony/webpack-encore');
const tailwindcss = require('tailwindcss');
const autoprefixer = require('autoprefixer');
const purgecss = require('@fullhuman/postcss-purgecss')({
content: [
'./templates/**/*.twig',
'./assets/js/**/*.vue',
'./assets/js/**/*.js',
@officeofjane
officeofjane / .block
Last active February 22, 2023 17:45
Bubble chart with d3-force
license: mit
@RobinDev
RobinDev / remove-ads-from-twitter.js
Last active January 15, 2019 15:39
Twitter Personalization : Remove Sidebar and Ads
// Share for educationnal purpose only
// --------------------
// To remove ads or sidebar from twitter, just inject this code (via cjs for example) :
// Current code work for the new Twitter TL from you favorite navigator (january 2019)
// --------------------
function removeSidebar() {
var elem = document.querySelector('[data-testid=sidebarColumn]');
if (elem) elem.parentNode.removeChild(elem);
}
@pierre-pretorius
pierre-pretorius / turbolinks_local_storage.js
Last active November 14, 2019 12:56
Store turbolinks cache in window.localStorage
@hans2103
hans2103 / .htaccess-mod_headers
Created April 13, 2015 08:33
.htaccess rules to set cache control.
<IfModule mod_headers.c>
Header set Connection keep-alive
# Cache-control headers
# 2 HOURS
#<filesMatch "*">
Header set Cache-Control "max-age=7200, must-revalidate"
#</filesMatch>
# 480 weeks - 290304000
@cgmartin
cgmartin / pre-commit
Last active October 9, 2015 06:17
ZF2 Git pre-commit hook
#!/usr/bin/env php
<?php
/**
* .git/hooks/pre-commit
*
* This pre-commit hooks will check for PHP errors (lint), and make sure the
* code is PSR-2 compliant.
*
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer)
*/
@havvg
havvg / ajax-form.js
Created August 1, 2012 13:20
jQuery AJAX form submit with Twitter Bootstrap modal
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active June 9, 2024 23:19
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version