Skip to content

Instantly share code, notes, and snippets.

View phun-ky's full-sized avatar
💯
fighting code like a boss

Alexander Vassbotn Røyne-Helgesen phun-ky

💯
fighting code like a boss
View GitHub Profile
<?php
/**
* File for parsing squid logs
*
* This file fetches lines from the squid log on the squid server and parsing the data to a mysql database
* @link http://phun-ky.net/2007/03/squid-log-parser
* @author Alexander Vassbotn Røyne
* @license Creative Commons, see http://phun-ky.net/license for more information
* @version 1.1
* @name UMedia SquidParser 1.1
# Rename multiple files
# http://www.24hourapps.com/2009/03/linux-tips-10-rename-multiple-files.html
# https://gist.github.com/alobato/397988
#
# Found the orignal gist very helpfull, and tweaked it to fit git mv
# First I suggest you test the outcome before you do the renaming, with a dry run (-n)
for f in $(git ls-files | grep %filestomatch%); do git mv -n "${f}" "${f/%filestomatch%/%newfilename_orlocation%}"; done;
@phun-ky
phun-ky / countries.json
Created March 4, 2015 14:11
A JSON list of all (?) countries with country code and calling codes with country names in english and norwegian
[{
"country_en": "Afghanistan",
"code": "AF",
"phonecode": 93,
"country_no": "Afghanistan"
}, {
"country_en": "Albania",
"code": "AL",
"phonecode": 355,
"country_no": "Albania"
@phun-ky
phun-ky / webpack.config.js
Last active July 10, 2018 10:51
webpack + postcss + extract-text-plugin = no CSS duplicates
postcss: () => {
return [
cssnano({
reduceIdents: false,
discardDuplicates: true,
autoprefixer: true
})
];
},modules: {
loaders: [{
module.exports = {
plugins: [
require('cssnano')({
preset: [
'advanced',
{
// autoprefixer: { add: true, exclude: false },
// discardComments: { removeAll: true, exclude: false },
// autoprefixer: false,
// calc: false,
module.exports = {
plugins: [
require('cssnano')({
preset: [
'default',
{
// autoprefixer: { add: true, exclude: false },
// discardComments: { removeAll: true, exclude: false },
// autoprefixer: false,
// calc: false,
module.exports = {
plugins: [
require('cssnano')({
preset: [
'default',
{
autoprefixer: { add: true, exclude: false },
discardComments: { removeAll: true, exclude: false },
autoprefixer: false,
calc: false,
module.exports = {
plugins: [
require('cssnano')({
preset: [
'advanced',
{
autoprefixer: { add: true, exclude: false },
discardComments: { removeAll: true, exclude: false },
autoprefixer: false,
calc: false,
module.exports = {
plugins: [
require('cssnano')({
preset: [
'advanced',
{
autoprefixer: { add: true, exclude: false },
discardComments: { removeAll: true, exclude: false },
calc: { exclude: true },
colormin: { exclude: true },
module.exports = {
plugins: [
require('cssnano')({
preset: [
'advanced',
{
autoprefixer: { add: true, exclude: false },
discardComments: { removeAll: true, exclude: false },
calc: { exclude: true },
colormin: { exclude: true },