Skip to content

Instantly share code, notes, and snippets.

View Kokil's full-sized avatar
🙃

Kokil Kokil

🙃
View GitHub Profile
@Kokil
Kokil / gist:ad5e0306e32935010380bd6eda776e16
Created March 16, 2017 10:07 — forked from ursuleacv/gist:9054247
Absolute center CSS Loading spinner
<div class="loading">Loading&#8230;</div>
/* Absolute Center CSS Spinner */
.loading {
position: fixed;
z-index: 999;
height: 2em;
@Kokil
Kokil / panoramio.sh
Created September 28, 2016 17:27 — forked from cdfmr/panoramio.sh
Download Panoramio pictures via user id
#!/bin/sh
delay=0
timeout=10
retry=2
usage()
{
echo "Usage: `basename $0` userid"
exit 1
@Kokil
Kokil / 01_Laravel 5 Simple ACL manager_Readme.md
Created July 20, 2016 07:19 — 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

@Kokil
Kokil / backup.php
Created June 28, 2016 04:50 — forked from menzerath/backup.php
PHP: Recursively Backup Files & Folders to ZIP-File
<?php
/*
* PHP: Recursively Backup Files & Folders to ZIP-File
* (c) 2012-2014: Marvin Menzerath - http://menzerath.eu
*/
// Make sure the script can handle large folders/files
ini_set('max_execution_time', 600);
ini_set('memory_limit','1024M');
@Kokil
Kokil / remote-typeahead.js
Created March 11, 2016 07:11 — forked from geuis/remote-typeahead.js
Remote data querying for Twitter Bootstrap 2.0 Typeahead without modifications
<script>
// Charles Lawrence - Feb 16, 2012. Free to use and modify. Please attribute back to @geuis if you find this useful
// Twitter Bootstrap Typeahead doesn't support remote data querying. This is an expected feature in the future. In the meantime, others have submitted patches to the core bootstrap component that allow it.
// The following will allow remote autocompletes *without* modifying any officially released core code.
// If others find ways to improve this, please share.
var autocomplete = $('#searchinput').typeahead()
.on('keyup', function(ev){
ev.stopPropagation();
@Kokil
Kokil / List.md
Last active February 3, 2016 11:36 — 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):

@Kokil
Kokil / App\Http\Kernel.php
Created February 1, 2016 07:30
Laravel 5 - Multiple Auth Database Tables - Native Way
<?php namespace App\Http;
/**
* 01 - Set the auth config as usual in app/config/auth.php file.
* This example uses Eloquent driver...
*
* 02 - Create a Middleware for each auth context ex: Admin, Customers.
*
* 03 - Register the Middlewares in app/Http/Kernel.php routeMiddleware array...
*
@Kokil
Kokil / capistrano-laravel-deploy.rb
Created January 25, 2016 05:10 — forked from arhea/capistrano-laravel-deploy.rb
Capistrano 3 deploy script for Laravel 4.
# config valid only for Capistrano 3.1
lock '3.1.0'
set :application, "" # EDIT your app name
set :scm, :git
set :repo_url, "" # EDIT your git repository
set :keep_releases, 3
@Kokil
Kokil / install.sh
Created January 21, 2016 10:54 — forked from fideloper/install.sh
Vagrant Provisioning Script for PHP applications. This installs a LAMP stack.
#!/usr/bin/env bash
echo ">>> Starting Install Script"
# Update
sudo apt-get update
# Install MySQL without prompt
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
@Kokil
Kokil / SparkCoreEventRecorder.js
Created January 3, 2016 10:38 — forked from harrisonhjones/SparkCoreEventRecorder.js
NodeJS SparkCore Event Recorder
// Includes
var EventSource = require('eventsource');
var mysql = require('mysql');
// Variables
var deviceID = "***FILL THIS IN***";
var accessToken = "***FILL THIS IN***";
// Mysql Connection
var connection = mysql.createConnection({