Skip to content

Instantly share code, notes, and snippets.

Giri Annamalai M giriannamalai

  • Galaxyweblinks
  • Aruppukottai
Block or report user

Report or block giriannamalai

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kasperkamperman
kasperkamperman / fixwrongutf8encoding.php
Created Jul 3, 2018
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'); ?>
<html>
<head>
<title>Fix wrong encoded UTF8 characters</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
</head>
<body>
<pre>
<?php
/* Problem description:
View aes_decrypt.py
import binascii
from Crypto.Cipher import AES
data = "abcdefghijklmnopqrstuvwxyz"
key = "pqrstuvwxyz$abcdefghijAB"
iv = "DEFGHTABCIESPQXO"
encrypted = "2324ab5ec7a901247bf01b08bd1956688843dad5a8e15106ca3a5b9258918527"
cipher = AES.new(key, AES.MODE_CBC, iv)
@worker8
worker8 / sed 101
Last active Apr 27, 2020
Useful sed regex collection
View sed 101
http://sed.sourceforge.net/sed1line.txt
-------------------------------------------------------------------------
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:
http://sed.sourceforge.net/sed1line.txt
http://www.pement.org/sed/sed1line.txt
@mgeeky
mgeeky / forticlientsslvpn-expect.sh
Last active May 14, 2020
Simple script intended to automate Fortinet SSL VPN Client connection on Linux using expect scripting.
View forticlientsslvpn-expect.sh
#!/bin/bash
# Forticlient SSL VPN Client launching script utilizing expect.
# --------------------------------------------
# CONFIGURATION
# If empty - script will take some simple logic to locate appropriate binary.
FORTICLIENT_PATH=""
@nicksantamaria
nicksantamaria / fork-example.php
Created Oct 20, 2016
Example: Parallel processing in PHP using pcntl_fork()
View fork-example.php
<?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()).
@cadrev
cadrev / pandas_shuffle.py
Last active Apr 16, 2020
Shuffle the rows of a python pandas dataframe
View pandas_shuffle.py
'''
Title : Pandas Row Shuffler
Author : Felan Carlo Garcia
'''
import numpy as np
import pandas as pd
def shuffler(filename):
df = pd.read_csv(filename, header=0)
# return the pandas dataframe
@phindmarsh
phindmarsh / composer.json
Last active Mar 16, 2019
Composer Install Verbose Output
View composer.json
{
"name": "phindmarsh/composer-test",
"description": "Testcase for checking dependencies bug",
"require": {
"silex/silex": "dev-master#279c773342c6c4d141ebd5236b18518c96505e00"
},
"authors": [
{
"name": "Patrick Hindmarsh",
"email": "patrick@hindmar.sh"
@sebmarkbage
sebmarkbage / Enhance.js
Last active May 21, 2020
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() {
@ranacseruet
ranacseruet / VideoStream.php
Last active May 20, 2020
PHP VideoStream class for HTML5 video streaming
View VideoStream.php
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";
@banrahan
banrahan / R.sublime-build
Created Jul 31, 2013
R build system for Sublime Text 3
View R.sublime-build
{
"cmd": ["/usr/local/bin/Rscript", "$file"],
"selector": "source.r"
}
You can’t perform that action at this time.