Skip to content

Instantly share code, notes, and snippets.

View SumonMSelim's full-sized avatar
🎯
Focusing

Muhammad Sumon Molla Selim SumonMSelim

🎯
Focusing
View GitHub Profile
@masnun
masnun / top_likers.py
Created March 5, 2016 21:17
Facebook Top Likers
import facebook
from collections import Counter
import requests
likes_counter = Counter()
# Get temp tokens at: https://developers.facebook.com/tools/explorer/
USER_ACCESS_TOKEN = ""
client = facebook.GraphAPI(access_token=USER_ACCESS_TOKEN, version='2.5')
@suwardany
suwardany / platform-blog.md
Last active April 29, 2016 15:19
Setup a blog extension with Cartalyst Platform 2

Setup a blog extension with Cartalyst Platform 2

Download Platform

git clone https://github.com/cartalyst/platform.git blog

Install Dependencies

Navigate into the downloaded folder and run

<?php
$template =[
'@name@' => [
'User name',
'Anik',
],
'@email@' => [
'Email',
'my.mail@mail.com'
from StringIO import StringIO
from openpyxl import Workbook
from openpyxl.compat import range
from openpyxl.cell import get_column_letter
from openpyxl.styles import Style, Font
def make_excel(dataset,
key_headers=None, # The order of attributes, or what to include
line_headers=None, # The order of table attributes, or what to include
import requests
from BeautifulSoup import BeautifulSoup as BS
import re
def get_dl_page(package_id):
get_request = requests.get('https://apkpure.com/search?q=' + package_id)
page = BS(get_request.text)
# it is assumed that the first search result is the thing we are looking for
link_ps = page.findAll('p', {'class': 'search-title'})
page_link = link_ps[0].a.get('href')
@leninhasda
leninhasda / auto-move-downloads.py
Created December 3, 2016 19:32
utility script to automatically move the specified files from downloads directory to proper directory
# import
import os
from os import path, listdir as list_dir, rename as move
from os.path import isdir as is_dir, isfile as is_file
from pprint import pprint
import shutil
# global variables
#==================
/*
|--------------------------------------------------------------------------
| Delete form macro
|--------------------------------------------------------------------------
|
| This macro creates a form with only a submit button.
| We'll use it to generate forms that will post to a certain url with the DELETE method,
| following REST principles.
|
*/
<?php namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Str;
class MakeAll extends Command
{
/**
* The name and signature of the console command.
*
// define route like this
Route::get('single/{id}/{any}',"BaseController@Single_Items")->name('item.single');
//make a function like below in your helper file
function Replace($data) {
$data = str_replace("'", "", $data);
$data = str_replace("!", "", $data);
$data = str_replace("@", "", $data);
$data = str_replace("#", "", $data);
<?php
// Visual composer get terms on dropdown params
if( !function_exists('vcdd_get_terms') ){
function vcdd_get_terms( $taxonomy = 'category' ){
$get_categories = get_categories( array(
'taxonomy' => $taxonomy,
) );
foreach ( $get_categories as $category ) {
$categories[] = [ $category->term_id => $category->name ];
}