Skip to content

Instantly share code, notes, and snippets.

View Nevon's full-sized avatar
:shipit:
Shipping

Tommy Brunn Nevon

:shipit:
Shipping
View GitHub Profile
This file has been truncated, but you can view the full file.
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;

Laxpasta

Ingredienser:

  • 300g Gravad lax
  • 1 knippe dill
  • 2dl Creme fraiche
  • 1 hönsbuljongtärning
  • ½ rödlök
  • Pasta
@Nevon
Nevon / nginx
Created July 25, 2016 11:45 — forked from tejasbubane/nginx
nginx logrotate script for centOS. Location: /etc/logrotate.d/nginx. Later change /etc/logrotate.conf add daily and change or comment "rotate" number (preferably comment to keep all log files -> symlinked to /mnt so no space issue)
/opt/nginx/logs/*.log {
daily
missingok
rotate 52
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate

When coming from large frameworks like Backbone, Ember or KnockoutJS, as many of us do, it's easy to get used to the fact that the framework provides a lot of "magic". The abstractions they provide, while extremely useful, are often so opaque that even if you wanted to, understanding how they are implemented is a hard task.

Because of this, it's no surprise that we expect the same thing from Redux. We see methods like combineReducers and concepts like action creators and assume that they are complicated, magical beasts that cannot be understood by mortal folk.

The intention of this post is to refute that by taking a look at the central concept of Redux - the store.

The problem

Every solution has a problem that it attempts to solve. Redux's problem is that application state is often spread out and complicated to reason about. The solution it provides is what it calls a state container - the store.

@Nevon
Nevon / Stegger.class.inc.php
Created March 26, 2013 07:51
Updated version of Stegger, a library for doing simple image steganography.
<?php
//+----------------------------------------------------------------------+
//| Stegger v0.6 |
//+----------------------------------------------------------------------+
//| Copyright (c) 2006 Warren Smith ( smythinc 'at' gmail 'dot' com ) |
//+----------------------------------------------------------------------+
//| This library is free software; you can redistribute it and/or modify |
//| it under the terms of the GNU Lesser General Public License as |
//| published by the Free Software Foundation; either version 2.1 of the |
@Nevon
Nevon / jquery.getwood.js
Last active December 15, 2015 01:09
This was by request. I swear.
/* Yeah... So... I don't want to know what you do with this. */
;(function ( $, window, document, undefined ) {
// Create the defaults once
var pluginName = "getWood",
defaults = {
length: 20
};
// The actual plugin constructor
function(dataURI) {
var byteString;
//Convert base64 to raw binary data
if (dataURI.split(',')[0].indexOf('base64') >= 0) {
byteString = atob(dataURI.split(',')[1]);
} else {
byteString = unescape(dataURI.split(',')[1]);
}
// github.com/paulirish/jquery-ajax-localstorage-cache
// dependent on Modernizr's localStorage test
$.ajaxPrefilter( function( options, originalOptions, jqXHR ) {
// Cache it ?
if ( !Modernizr.localstorage || !options.localCache ) return;
var hourstl = options.cacheTTL || 5;
var cacheKey = options.cacheKey || options.url.replace( /jQuery.*/,'' ) + options.type + options.data;