Skip to content

Instantly share code, notes, and snippets.

View shivakaushal's full-sized avatar
🏠
Working remotely

SK shivakaushal

🏠
Working remotely
  • Canada
View GitHub Profile
@shivakaushal
shivakaushal / eef50a2177d5640f6643fde7470bbbdc.txt
Last active March 10, 2021 15:03
Whenever I'm about to do something, I think 'Would an idiot do that?
Who is Justice Beaver?

Keybase proof

I hereby claim:

  • I am shivakaushal on github.
  • I am kaushal (https://keybase.io/kaushal) on keybase.
  • I have a public key ASCJVAfQr0bHr9P2f6DFTwa3iZAOULRq5yoB7jnmRXJRpAo

To claim this, I am signing this object:

@shivakaushal
shivakaushal / books.md
Created October 1, 2019 23:46
Interesting books

Classic Shell Scripting - 1st Edition

Linux Device Drivers - 3rd Edition

Introducing Regular Expressions - 1st Edition

grep Pocket Reference - 1st Edition

Learning GNU Emacs - 3rd Edition

You can increase max_input_vars in your php.ini file:
`max_input_vars = 3000`
or in an .htaccess document:
`php_value max_input_vars 3000`
After doing that you should find that you can once again save a large number of custom fields.
@shivakaushal
shivakaushal / index.php
Last active August 12, 2016 08:08
tighten-co code challenge
<?php
/**
* Instructions:
*
* Given the above JSON (https://gist.github.com/mattstauffer/a1250aad49b3a476339c1f8960195ba0),
* build a simple PHP script to import it.
*
* Your script should create two variables:
*
@shivakaushal
shivakaushal / zip.php
Last active May 10, 2016 14:18
zipping functionality for IP download
use \PHPZip\Zip\Stream\ZipStream;
...
if (file_exists($file)) {
ob_start();
$zipFile = "Investment_Proposal_$lang.zip";
$zip = new ZipStream($zipFile);
// Yii2 - Output the SQL from a query builder
$query->createCommand()->getRawSql()
@shivakaushal
shivakaushal / post_php
Last active March 4, 2018 01:37
POST request with PHP ( CURL-less method with PHP5 )
$url = 'http://server.com/path';
$data = array('key1' => 'value1', 'key2' => 'value2');
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data),
),
@shivakaushal
shivakaushal / doveadm_expunge
Created November 17, 2015 23:03
dovecot remove emails before YYYY-MM-DD
doveadm expunge -u user@email.com mailbox '*' before YYYY-MM-DD
@shivakaushal
shivakaushal / Generate long-term Facebook access token
Last active August 29, 2015 14:13
Generate long-term Facebook access token
https://graph.facebook.com/oauth/access_token?client_id=[CLIENT_ID_GOES_HERE]&client_secret=[CLIENT_SECRET_GOES_HERE]&grant_type=fb_exchange_token&fb_exchange_token=[SHORT_TERM_ACCESS_TOKEN_GOES_HERE]