Skip to content

Instantly share code, notes, and snippets.

View saji89's full-sized avatar

Saji Nediyanchath saji89

View GitHub Profile
@saji89
saji89 / sublime-phpcs.md
Last active May 1, 2023 21:32
Steps to setup PHP code sniffer package in Sublime text

Steps

  1. Install the package using Package Control - PhpCs(sublime-phpcs)

  2. Download the phar files needed for the functioning of the plugin:

curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
@saji89
saji89 / extract-attachments.py
Created August 28, 2018 18:36 — forked from stefansundin/extract-attachments.py
Extract attachments from emails that Gmail doesn't allow you to download. This is dumb. Please use Python >= 3.4.
#!/usr/bin/env python3
# Get your files that Gmail block. Warning message:
# "Anti-virus warning - 1 attachment contains a virus or blocked file. Downloading this attachment is disabled."
# Based on: https://spapas.github.io/2014/10/23/retrieve-gmail-blocked-attachments/
# Instructions:
# Go to your emails, click the arrow button in the top right, "Show original", then "Download Original".
# Move the files to the same directory as this program, then run it.
import email
@saji89
saji89 / json_unicode_decode.php
Created October 15, 2015 06:41
Unicode encoded value conversion
<?php
function unescapeUTF8EscapeSeq($str)
{
return preg_replace_callback("/\\\u([0-9a-f]{4})/i",
create_function('$matches',
'return html_entity_decode(\'&#x\'.$matches[1].\';\', ENT_QUOTES, \'UTF-8\');'
), $str);
}
$unicodeEncodedvalue = '\u041d\u0438\u043a\u043e\u043b\u0430\u0439 \u0420\u0435\u0448\u0438\u0442\u043a\u043e';
@saji89
saji89 / Laravel\app\commands\ViewsCommand.php
Created June 10, 2016 12:37 — forked from cjonstrup/Laravel\app\commands\ViewsCommand.php
Clear Laravel 4.* app/storage/views artisan views:clear
<?php
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
class ViewsCommand extends Command {
/**
* The console command name.
*
* @var string
@saji89
saji89 / wotd.md
Last active January 4, 2016 21:39
Word of the Day

01/02/2014 (Alvar)

persuade (പ്രേരിപ്പിക്കുക)

  • induce (someone) to do something through reasoning or argument.

30/01/2014 (Nisanth)

deliberate ( സസൂക്ഷ്‌മം, മന:പൂര്‍വ്വമായ, കരുതിക്കൂട്ടിയുളള)

  • Done consciously and intentionally.
  • adjective : carefully thought out in advance
    • Example
  • with measured irony
@saji89
saji89 / gist:7818823
Created December 6, 2013 05:00 — forked from idan/gist:3135754

Hello there! This is a sample post for gist.io, a super-lightweight writing soapbox for hackers.

Now look up. Further. Above the post title. See that grey text with the gist ID?

Now back to me. That grey text is a link! Open that sucker in a new tab to see the source for this post. Also, I'm on a horse.

This is a major heading

If you peek at it with a web inspector, you'll see that it is a second-level heading. You can use first level headings, but they'll look just like the second level ones, and the gods of the HTML5 outlining algorithm will frown upon you.

@saji89
saji89 / tips.md
Last active December 29, 2015 23:59
Some commands for the linux world

Some Linux Tips

Kill problematic application/process in Linux

If you experience a freeze in the display due to different reasons(mostly memory related), if you're able to reach to one of the virtual terminals

Ctrl+Alt+(F1/F2/F3/F4/F5/F6), you can kill the rogue app you believe to have caused the freeze. Let us assume that the rogue app is Firefox. First search for the Processid(pid) of the app, I use the following for that:

ps aux| grep 'firefox'

@saji89
saji89 / Rendering Views in Zend.md
Last active December 28, 2015 23:29
Various ways to render views in Zend
  1. Partials

The Partial view helper is used to render a specified template within its own variable scope. The primary use is for reusable template fragments with which you do not need to worry about variable name clashes. Additionally, they allow you to specify partial view scripts from specific modules.

<?php // partial.phtml ?>
<ul>
    <li>From: <?php echo $this->escape($this->from) ?></li>
    <li>Subject: <?php echo $this->escape($this->subject) ?></li>
@saji89
saji89 / afterformreset.js
Created October 21, 2013 05:51
Calling a function after the form reset event. Courtesy: http://stackoverflow.com/a/12178710/749232 The regular reset event of a form fires as and when the reset is clicked, and we do not get the state after the form reset. For getting that state we can use this code.
$(document).ready(function() {
$("input:reset").click(function() { // apply to reset button's click event
this.form.reset(); // reset the form
// call your functions to be executed after the reset
return false; // prevent reset button from resetting again
});
});
@saji89
saji89 / dabblet.css
Created January 17, 2013 08:26
Logo in Css
/**
* Logo in Css
*/
body { width: 0; margin: 5% auto; background: #212e36; }
.ixlogo {
font-size: 3em; /* <--- EDIT THIS TO RESIZE */
font-family: Arial Black, sans-serif; font-weight: 900;