Skip to content

Instantly share code, notes, and snippets.


Giri Annamalai M giriannamalai

View GitHub Profile
giriannamalai / fixwrongutf8encoding.php
Created May 20, 2020 — forked from kasperkamperman/fixwrongutf8encoding.php
Function to fix ut8 special characters displayed as 2 characters (utf-8 interpreted as ISO-8859-1 or Windows-1252)
View fixwrongutf8encoding.php
<?php header('Content-Type: text/html; charset=utf-8'); ?>
<title>Fix wrong encoded UTF8 characters</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
/* Problem description:
giriannamalai / sed 101
Created Apr 27, 2020 — forked from worker8/sed 101
Useful sed regex collection
View sed 101
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005
Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5
Latest version of this file (in English) is usually at:
giriannamalai /
Created Apr 4, 2020 — forked from mgeeky/
Simple script intended to automate Fortinet SSL VPN Client connection on Linux using expect scripting.
# Forticlient SSL VPN Client launching script utilizing expect.
# --------------------------------------------
# If empty - script will take some simple logic to locate appropriate binary.
giriannamalai /
Created Jun 4, 2019 — forked from oisobstudio/
Django Pagination Server-Side Menggunakan DataTable


import json

from django.views.generic import View
from django.http import HttpResponse
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.db.models import Q
from django.core.serializers.json import DjangoJSONEncoder
giriannamalai / VideoStream.php
Created Jul 25, 2018 — forked from ranacseruet/VideoStream.php
PHP VideoStream class for HTML5 video streaming
View VideoStream.php
* Description of VideoStream
* @author Rana
* @link
class VideoStream
private $path = "";
giriannamalai / JavaScript.sublime-build
Created Feb 16, 2018 — forked from corbanb/JavaScript.sublime-build
Sublime Text - Tools > Build System > New Build System
View JavaScript.sublime-build
// Sublime Text - Build System for Javascript
"cmd": ["node", "$file"],
"selector": "source.js"
giriannamalai / fork-example.php
Created Dec 23, 2017 — forked from nicksantamaria/fork-example.php
Example: Parallel processing in PHP using pcntl_fork()
View fork-example.php
* @file
* Basic demonstration of how to do parallel threads in PHP.
// This array of "tasks" could be anything. For demonstration purposes
// these are just strings, but they could be a callback, class or
// include file (hell, even code-as-a-string to pass to eval()).
giriannamalai /
Created Nov 14, 2017 — forked from msurguy/
Laravel 4 Eloquent Cheat Sheet.


Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):

class Shop extends Eloquent {}

Using custom table name

protected $table = 'my_shops';

giriannamalai / Enhance.js
Created Nov 10, 2017 — forked from sebmarkbage/Enhance.js
Higher-order Components
View Enhance.js
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
componentDidMount() {
this.setState({ data: 'Hello' });
render() {
You can’t perform that action at this time.