Skip to content

Instantly share code, notes, and snippets.

@codegenin
codegenin / vscode-vue.sett
Last active December 21, 2018 02:49
VSCode VueJs Initial Project Settings
### Plugins
Vetur
ESlint
Prettier
Copy Relative Path
Vue VSCode Snippets by Sarah.Drasner - Add in user settings "vetur.completion.userScaffoldSnippets":false
Themes - Night Owl / FlatUI
### for nuxtjs install
npm i -D eslint-plugin-prettier eslint-config-prettier
Following on from other Gists I have posted, this one shows a neat way of using Includes to centralise general blocking rules for Bad Bots, creepy crawlers and irritating IPs
see the full post at http://www.blue-bag.com/blog/apache-better-blocking-common-rules
@codegenin
codegenin / gist:6a6d251808417042252fe4c05db0258f
Last active March 22, 2018 02:52 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@codegenin
codegenin / dob.html
Created October 7, 2015 10:57
Months and Days Select List
<!-- Month dropdown -->
<select name="month" id="month" onchange="" size="1">
<option value="01">January</option>
<option value="02">February</option>
<option value="03">March</option>
<option value="04">April</option>
<option value="05">May</option>
<option value="06">June</option>
<option value="07">July</option>
<option value="08">August</option>
@codegenin
codegenin / countries.php
Created October 5, 2015 08:45
List of countries in Array
[
"United States" => "us",
"Afghanistan" => "af",
"Albania" => "al",
"Algeria" => "dz",
"American Samoa" => "as",
"Andorra" => "ad",
"Angola" => "ad",
"Anguilla" => "ai",
"Antarctica" => "aq",
@codegenin
codegenin / gulpfile.js
Created September 29, 2015 17:03 — forked from laracasts/gulpfile.js
Example Laravel-specific Gulpfile from Laracasts.com
var gulp = require('gulp');
var gutil = require('gulp-util');
var notify = require('gulp-notify');
var sass = require('gulp-ruby-sass');
var autoprefix = require('gulp-autoprefixer');
var minifyCSS = require('gulp-minify-css')
var coffee = require('gulp-coffee');
var exec = require('child_process').exec;
var sys = require('sys');
@codegenin
codegenin / bower.json
Last active June 7, 2017 14:30
Gulp + Bootstrap SASS + AngularJS + Font-Awesome
"dependencies": {
"angular": "~1.4.5",
"angular-animate": "~1.4.5",
"angular-ui-router": "~0.2.15",
"animate.css": "~3.4.0",
"bootstrap": "~3.3.5",
"bootstrap-sass": "bootstrap-sass-official#~3.3.5",
"font-awesome": "fontawesome#~4.4.0",
"jquery": "~2.1.4"
}
@codegenin
codegenin / PHPcronfilelock.php
Last active September 9, 2015 16:30
Prevent multiple crons running by creating a lock file and time limit
<?php
$filename = "myscript.lock";
$lifelimit = 120; // in Second lifetime to prevent errors
/* check lifetime of file if exist */
if(file_exists($filename)){
$lifetime = time() - filemtime($filename);
}else{
$lifetime = 0;
}
/* check if file exist or if file is too old */
@codegenin
codegenin / 01_Laravel 5 Simple ACL manager_Readme.md
Last active August 27, 2015 19:27 — forked from amochohan/01_Laravel 5 Simple ACL manager_Readme.md
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@codegenin
codegenin / Model.php
Last active August 29, 2015 14:27
Laravel - set a field into a slug on record insert
<?php
/**
* Set name field to slug on insert
*
* @param $name
*/
public function setNameAttribute($name)
{
$this->attributes['name'] = $name;