Skip to content

Instantly share code, notes, and snippets.

View Faks's full-sized avatar
🐎
Still horsing around.

Oskars Germovs Faks

🐎
Still horsing around.
View GitHub Profile
@Faks
Faks / media-query.css
Created February 11, 2018 08:23 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@Faks
Faks / auto_zoom_markers.js
Created February 25, 2018 19:27 — forked from ericchen/auto_zoom_markers.js
Auto Zoom To Fit All Markers on Google Maps API v3
var LatLngList = new Array (new google.maps.LatLng (52.537,-2.061), new google.maps.LatLng (52.564,-2.017));
// Create a new viewpoint bound
var bounds = new google.maps.LatLngBounds ();
// Go through each...
for (var i = 0, LtLgLen = LatLngList.length; i < LtLgLen; i++) {
// And increase the bounds to take this point
bounds.extend (LatLngList[i]);
}
// Fit these bounds to the map
map.fitBounds (bounds);
@Faks
Faks / capitalize_while_inputting.js
Created April 12, 2018 05:19 — forked from alex-gist/capitalize_while_inputting.js
jQuery: Capitalize first letter while typing inside input field
<script type="text/javascript" charset="utf-8">
//Capitalize first letter while typing in side of input field
jQuery(document).ready(function($) {
$('#selector').keyup(function(event) {
var textBox = event.target;
var start = textBox.selectionStart;
var end = textBox.selectionEnd;
textBox.value = textBox.value.charAt(0).toUpperCase() + textBox.value.slice(1);
textBox.setSelectionRange(start, end);
});
@Faks
Faks / global.php
Created April 15, 2018 10:12 — forked from RowlandOti/global.php
Laravel 4.2 Example of how to log errors and exceptions
<?php
/*
|--------------------------------------------------------------------------
| Register The Laravel Class Loader
|--------------------------------------------------------------------------
|
| In addition to using Composer, you may use the Laravel class loader to
| load your controllers and models. This is useful for keeping all of
| your classes in the "global" namespace without Composer updating.
@Faks
Faks / url_slug.php
Created April 26, 2018 17:14 — forked from sgmurphy/url_slug.php
URL Slugs in PHP (with UTF-8 and Transliteration Support)
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
@Faks
Faks / MigrateSpecificCommand.php
Created September 22, 2018 21:59 — forked from miadz/MigrateSpecificCommand.php
Migrate specific migrations with this command
<?php
/* Instructions:
* 1. Add this class file to your app/Console folder
* 2. Register command in app/Console/Kernel by adding `\App\Console\Commands\MigrateSpecificCommand::class` it to commands array
* 3. Done, now you can access it like: php artisan migrate:specific 2014_10_12_000000_create_users_table,2014_10_12_100000_create_password_resets_table
*/
namespace App\Console\Commands;
@Faks
Faks / Calendar_Function.php
Last active October 2, 2018 16:06 — forked from Vinze/calendar.php
Create an HTML calendar with PHP and Carbon
<?php
public static function Render()
{
#Sets Current Date
$dt = Carbon::createFromFormat('Y,m,d', Date('Y,m,d'));
// Make sure to start at the beginning of the month
$dt->startOfMonth();
// Set the headings (weeknumber + weekdays)
@Faks
Faks / README.md
Created October 4, 2018 19:46 — forked from emsifa/README.md
Laravel 5.1 Validation Outside Laravel

Laravel 5.1 Validation Outside Laravel

First you need to install illuminate/validation by typing this composer require illuminate/validation:5.1.*.

Then, you can use laravel validation like this:

$validatorFactory = new ValidatorFactory;
@Faks
Faks / app.js
Created November 4, 2018 16:59 — forked from reinink/app.js
Auto register Vue components
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/
require('./bootstrap');
window.Vue = require('vue');
@Faks
Faks / vhost.py
Created November 7, 2018 20:24 — forked from fideloper/vhost.py
Create vHost Ubuntu Lamp-Server (bash and python)
#! /usr/bin/python
from sys import argv
from os.path import exists
from os import makedirs
from os import symlink
from os import system
import getopt
#