Skip to content

Instantly share code, notes, and snippets.

Giri Annamalai M giriannamalai

  • 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
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)
@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 Aug 30, 2019
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 Oct 19, 2019
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 Oct 18, 2019
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"
}
@6174
6174 / Random-string
Created Jul 23, 2013
Generate a random string in JavaScript In a short and fast way!
View Random-string
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@msurguy
msurguy / eloquent.md
Last active Feb 13, 2019
Laravel 4 Eloquent Cheat Sheet.
View eloquent.md

Conventions:

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';

@sagar-ganatra
sagar-ganatra / localStorage.html
Created Oct 10, 2012
Local storage event listeners
View localStorage.html
<!DOCTYPE html>
<html>
<head>
<title>localStorage Test</title>
<script type="text/javascript" >
var count = 0;
var storageHandler = function () {
alert('storage event 1');
};
You can’t perform that action at this time.