Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Muhammad Sumon Molla Selim SumonMSelim

🎯
Focusing
View GitHub Profile
@shahariaazam
shahariaazam / ZIPMaker.php
Created Feb 3, 2013
Create .ZIP archive in PHP
View ZIPMaker.php
<?php
/**
* @Author Shaharia Azam
* @Author URL http://www.shahariaazam.com
*
* @Description this function will make a .zip folder by adding multiple files.
* @link http://php.net/manual/en/book.zip.php
*
* @param array $SourceFiles
* @param string $ZipDestination
@masnun
masnun / top_likers.py
Created Mar 5, 2016
Facebook Top Likers
View top_likers.py
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 Apr 29, 2016
Setup a blog extension with Cartalyst Platform 2
View platform-blog.md

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

View string_replace_callback_solution.php
<?php
$template =[
'@name@' => [
'User name',
'Anik',
],
'@email@' => [
'Email',
'my.mail@mail.com'
View excelify.py
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
View apk_download.py
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 Dec 3, 2016
utility script to automatically move the specified files from downloads directory to proper directory
View auto-move-downloads.py
# 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
#==================
View Form::delete macro
/*
|--------------------------------------------------------------------------
| 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.
|
*/
View MakeAllCommand.php
<?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.
*
View gist:aa425a4d3e37665c5c6a1e812c76b5cd
// 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);