Skip to content

Instantly share code, notes, and snippets.

@kostasxyz
kostasxyz / sample.md
Created May 17, 2022 11:06 — forked from reanim8ed/sample.md
[Mailhog in Laragon] #email #laragon #laragon
@kostasxyz
kostasxyz / vue.md
Created May 23, 2020 21:03 — forked from DawidMyslak/vue.md
Vue.js and Vuex - best practices for managing your state

Vue.js and Vuex - best practices for managing your state

Modyfing state object

Example

If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).

Example below explains implications for different implementations.

@kostasxyz
kostasxyz / gulpStringToFile.js
Created February 18, 2017 12:00 — forked from leocaseiro/gulpStringToFile.js
Create a file within String using Gulp
gulp.task('createFile', function() {
var filename = 'app.js';
var string = "(function() {\n 'use strict';\n angular.module('App', ['ui-route']);\n})();";
return stringToFile(filename, string)
.pipe(gulp.dest('./js'));
});
function stringToFile(filename, string) {
var src = require('stream').Readable({ objectMode: true });
src._read = function () {
@kostasxyz
kostasxyz / SecureSessionHandler.php
Created January 27, 2017 14:47 — forked from eddmann/SecureSessionHandler.php
Secure session handler implementation.
<?php
class SecureSessionHandler extends SessionHandler {
protected $key, $name, $cookie;
public function __construct($key, $name = 'MY_SESSION', $cookie = [])
{
$this->key = $key;
$this->name = $name;
/* ----------------------------------------------------------------------------------------------------
Super Form Reset
A couple of things to watch out for:
- IE8: If a text input doesn't have padding on all sides or none the text won't be centered.
- The default border sizes on text inputs in all UAs seem to be slightly different. You're better off using custom borders.
- You NEED to set the font-size and family on all form elements
- Search inputs need to have their appearance reset and the box-sizing set to content-box to match other UAs
@kostasxyz
kostasxyz / .htaccess
Last active September 24, 2020 07:01 — forked from wycks/htaccess cache and stuff
Boilerplate .htaccess from Paul Irish with WordPress added
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>