Skip to content

Instantly share code, notes, and snippets.

@jslim89
jslim89 / gist:4044092
Created November 9, 2012 06:42
SVN commit a modified file with a keyword that match the file path
$ svn st | grep -v '^?' | awk '{print $2}' | grep "keyword" | xargs svn commit -m "- commit message"
@jslim89
jslim89 / array_single_to_multi_lvl.php
Last active October 27, 2015 02:50
Joomla menu list from single-dimention to multi-dimentional array
<?php
/**
* Refer: https://stackoverflow.com/questions/14961556/convert-one-dimensional-array-into-a-multi-dimensional-array/14963016#14963016
*
* @param mixed $menu_items
* @param int $depth
* @access public
* @return array
*/
function array_multi_level($menu_items, $depth = 1) {
@jslim89
jslim89 / 01_Laravel 5 Simple ACL manager_Readme.md
Created October 27, 2015 02:51 — 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

@jslim89
jslim89 / 0-Laravel_5_helpers.md
Last active November 18, 2015 04:57
Laravel 5 helpers

Create helpers in Laravel 5

First, create a helper folder

$ mkdir app/Helpers

Then create helper files, in my case I create route helper

@jslim89
jslim89 / ig-scraper.py
Last active April 13, 2018 03:39 — forked from marcoqu/scraper.py
The instagram internal api
import time
import re
from hashlib import md5
import requests
INSTAGRAM_URL = "https://www.instagram.com"
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"
INSTAGRAM_USER = "youruname"
INSTAGRAM_PASS = "yoursecret"
@jslim89
jslim89 / ig-login.py
Created April 26, 2018 06:34
Instagram login through requests
import requests
import pprint
INSTAGRAM_URL = 'https://www.instagram.com'
USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36'
IG_ACCOUNTS = [
{'username': 'username1', 'password': 'pass1'},
{'username': 'username2', 'password': 'pass2'},
]