Skip to content

Instantly share code, notes, and snippets.

@kevindaus
kevindaus / How to change placeholder of input type date
Created March 14, 2018 18:26
How to change placeholder of input type date
input[type="date"]::before{
color: #999;
content: attr(placeholder);
margin-right: 122px; // push the default placeholder out.. you can add more if you want
}
input[type="date"]:focus::before {
content: "" !important;
display: none;
}
example inside FOO_VAR.env
located somewhere in your secret folder
PROD_DB_USERNAME = "foobar"
PROD_DB_PASSWORD = "veryveryharduncrackablepassword"
PROD_DB_HOST = "localhost"
PROD_DSN = "mysql:host=localhost;dbname=something_db"
then in your web/index.php
/*HTTPS for prod*/
if (!defined('YII_DEBUG')) {
if(!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == ""){
$redirect = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
header("HTTP/1.1 301 Moved Permanently");
header("Location: $redirect");
}
}
@kevindaus
kevindaus / GridPageSize.php
Created August 25, 2016 19:11
Yii2 GridPageSize
<?= GridPageSize::widget(['pjaxId'=>'myAwesomeGridViewContainer']) ?>
<?php
Pjax::begin([
'id'=>'myAwesomeGridViewContainer',
])
?>
<?=
GridView::widget([
@kevindaus
kevindaus / remap.json
Last active August 23, 2016 20:37
How to remap hjkl in sublime text 2 vintage mode
{ "keys": ["k"], "command": "set_motion", "args": {
"motion": "move",
"motion_args": {"by": "lines", "forward": true, "extend": true },
"linewise": true },
"context": [{"key": "setting.command_mode"}]
},
{ "keys": ["i"], "command": "set_motion", "args": {
"motion": "move",
"motion_args": {"by": "lines", "forward": false, "extend": true },
@kevindaus
kevindaus / Person.php
Created August 23, 2016 20:32
Person class in public gist
<?php
/**
* Person
*/
class Person extends BadPerson
{
public $firstname;
public $lastname;
public $isGoodPerson;
function __construct($firstname,$lastname,$isGoodPerson = false)