Skip to content

Instantly share code, notes, and snippets.

View anis016's full-sized avatar

Sayed Anisul Hoque anis016

View GitHub Profile
@anis016
anis016 / 01_Laravel 5 Simple ACL manager_Readme.md
Created March 19, 2016 21:01 — 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

@anis016
anis016 / List.md
Created April 2, 2016 17:41 — forked from msurguy/List.md
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@classmethod
def find_by_url(cls, url):
"""
Return a store from a url like "http://www.johnlewis.com/house-by-john-lewis-curve-dining-chair-white/p231441579"
http://www.johnlewis.com --> is the prefix stored in the Store, thus call the find_by_url_prefix to get Store
:param url: The item's URL
:return: a Store, or raises a StoreNotFoundException if no store matches the url
"""
store_obj = Database.find(StoreConstants.COLLECTION, {})
url_list = [store['url_prefix'] for store in store_obj]
@anis016
anis016 / views.py
Created August 31, 2016 22:43
Store models [view.py]
@store_blueprint.route('/edit/<string:store_id>', methods=['POST', 'GET'])
def edit_store(store_id):
if request.method == 'POST':
name = request.form['name']
url_prefix = request.form['url_prefix']
tag_name = request.form['tag_name']
query = json.loads(request.form['query'])
store = Store(name, url_prefix, tag_name, query, store_id)
store.update_db(store_id)
sap.ui.jsview("easybike.bikes", {
/** Specifies the Controller belonging to this View.
* In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.
* @memberOf easybike.bikes
*/
getControllerName : function() {
return "easybike.bikes";
},
@anis016
anis016 / hiring_developers
Created March 18, 2017 22:04 — forked from markalanevans/hiring_developers
Job Hiring Boards
Coding:
http://jobs.readwriteweb.com/
http://noodleyard.com/
http://angel.co/jobs
http://startuply.com/
http://jobs.37signals.com/
http://www.dice.com/
http://jobs.github.com/
http://www.craigslist.org
http://news.ycombinator.com/jobs
import os
import pandas as pd
import numpy as np
from pandas import DataFrame
project_path = os.path.dirname(os.path.abspath(__file__))
data_path = os.path.join(project_path, 'data/')
file_row_capacity = os.path.join(data_path, 'row_capacity.csv')
file_tickets_sold = os.path.join(data_path, 'tickets_sold.csv')
[Setup for the Centos minimal version]
[Note: After setting up the Static network then use SSH to connect the VM for easy editing]
## Static network setup in Centos 7.X minimal
1. Check the default gateway, dns servers address of the host machine
> Default gateway: 192.168.188.1
> DNS servers: 8.8.8.8, 8.8.4.4
2. VM -> Network -> Adapter 1 = NAT, Adapter 2 = Bridged Adapter
3. Start the VM
0. Login with Root mode and always give the commands with root access
$ sudo su
1. Pre-Installation Steps [In all the nodes]
1.1 Fix Swappiness:
$ cat /proc/sys/vm/swappiness
$ sysctl -w vm.swappiness=1
$ cat /proc/sys/vm/swappiness
$ vi /etc/sysctl.conf