You are here

Web development includes non-design aspects of building web sites: writing markup and coding.
snippet - PHP: First x characters of a string
2 Nov, 2017
Get first n amount of characters from a string. You could use substr for that, but you will get empty results when there are special characters. Thus multibyte string method is the right way to go.
snippet - PHP: Instagram to RSS feed
2 Aug, 2017
Instagram gives out json feed. You can use this little php snippet to create rss feed from the given json. The script leverages paging, which enables you to control the items count in the output feed.
snippet - React: Warning: Failed context type: The context `router` is marked as required in `Link`, but its value is `undefined`
25 Jul, 2017
Testing React components with Jest I got an error: "Warning: Failed context type: The context `router` is marked as required in `Link`, but its value is `undefined`.". I am using Link from react-...
snippet - Webpack: Remove comments from compressed css
1 Jun, 2017
You can minify css with optimize-css-assets-webpack-plugin, but by default some comments are left untouched. If you want to remove all comments you have to use an option for the cssnano, that is used...
written tutorial - Serve static gzip with webpack and nginx
1 Jun, 2017
Tutorial for serving static gzip with webpack module bundler and nginx server. When you would use nginx directly to compress the output, it would do it on the run and with some load increase the cpu...
snippet - Javascript: move item to end of array (of objects), by property value
29 May, 2017
The snippet shows how to move item to the end of array. In a case where we have an array of objects and we want to move the array item by property value. In this example I am using lodash/underscore...
snippet - PHP: Encode Url for Curl
23 May, 2017
PHP
This snippet encodes urls for curl. If you use special letters like äõöü in url, then you get a bit different url parsing from browsers than curl in PHP. You would think that you could use php's own...
snippet - 401 Unauthorized Error with https redirection
22 May, 2017
Got an unauthorized error from htaccess passwords after https redirection implementation. This was an unexpected result, but I guess what happens is that you are redirected to access denied page...
snippet - PHP: Fix url query parameters starting with
19 May, 2017
PHP
Snippet shows you how to fix url query parameters starting with "...
snippet - WordPress: force https using .htaccess
19 May, 2017
Since Google says https gives websites a small ranking benefit and Let's Encrypt gives free certs, more and more sites have been converted. This is a more thurral snippet of https redirection. It has...