Skip to content

Instantly share code, notes, and snippets.

View ppshobi's full-sized avatar
😍
Building Crap

Shobi ppshobi

😍
Building Crap
View GitHub Profile
$rules = [
// standard
'@PHP81Migration' => true,
'@PHP80Migration:risky' => true,
'@PSR1' => true,
'@PSR2' => true,
'@PSR12' => true,
'@PSR12:risky' => true,
'@Symfony' => true,
'@PhpCsFixer' => true,

Case A

path: /banana

method: post

payload:

{
@ppshobi
ppshobi / CircularIterator.php
Created February 20, 2019 06:52
CircularIterator - An InfininIteIterator for PHP
<?php
use Iterator;
class CircularIterator implements Iterator
{
private $entries;
public function __construct($entries)
{
@ppshobi
ppshobi / Configuring Celery And SQS with Pycurl Problem in MacOS, Ubuntu.md
Last active May 11, 2022 11:46
Configuring Celery And SQS with Pycurl Problem in MacOS, Ubuntu

Fix Pycurl Installation issues In Mac and Linux

Celery uses a package called kombu, which requires the pycurl library to communicate with sqs, but installing pycurl has never come easy to me. even though sometimes it gets installed through pip, when I start celery it was saying pycurl library is required. the problem lies with the ssl library requirement of pycurl Here is a set of commands which worked for me

Mac Os (High Sierra)

brew install curl --with-openssl

#!/usr/bin/env python3
import csv
import sys
import re
#######################
## Configurations ##
#######################
@ppshobi
ppshobi / array_walk_recursive.php
Created September 21, 2017 04:57
array_walk_recursive - Example
<?php
$array = [
'a' => [
'z' => 'abcs ',
'y' => ' xzsy ',
'x' => 'abc xyz',
'w' => [
'elem1' => ' gasd fsdf ',
'elem2' => 'ash fhakjs d '
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"serverSourceRoot": "/home/vagrant/Code",
"localSourceRoot": "${workspaceRoot}",
Artisan
// Displays help for a given command
php artisan --help OR -h
// Do not output any message
php artisan --quiet OR -q
// Display this application version
php artisan --version OR -V
// Do not ask any interactive question
php artisan --no-interaction OR -n
// Force ANSI output
@ppshobi
ppshobi / AESCipher.py
Created April 13, 2017 17:15 — forked from chrcoe/AESCipher.py
PyCrypto AES using ECB mode implementation in Python 3.3. This uses very basic 0x00 padding, I would recommend PKCS5/7
'''
Created on Mar 20, 2014, uses PyCrypto/Python 3.3
@author: Chris Coe
'''
import binascii
from Crypto.Cipher import AES
class AESCipher:
'''
remove space, split by 32 bit length strings, (ie:md5 hashes have 32 bit length) try decoding using any online md5 decoder