Skip to content

Instantly share code, notes, and snippets.

View gayanhewa's full-sized avatar
🦧
I may be slow to respond.

Gayan gayanhewa

🦧
I may be slow to respond.
View GitHub Profile
<?php
$databasehost = "localhost";
$databasename = "db";
$databasetable = "temp";
$databaseusername ="root";
$databasepassword = "root";
$fieldseparator = ",";
$lineseparator = "\n";
$csvfile = "csv.csv";
@gayanhewa
gayanhewa / signature.php
Created January 19, 2015 03:48
Signature ( POST with json_encode )
<?php
/**
* This snippet implements the logic behing https://github.com/philipbrown/signplz , simply to explain the functionality of generating the auth signature
* for non-php programmers so that they can authenticate with the API without a problem.
**/
$api_key = "key";
$api_sec = "sec";
$url = "http://abc.com/api/signin";
@gayanhewa
gayanhewa / signature-get-requests.php
Created February 6, 2015 03:21
Signature ( GET requests )
<?php
/**
* This snippet implements the logic behing https://github.com/philipbrown/signplz , simply to explain the functionality of generating the auth signature
* for non-php programmers so that they can authenticate with the API without a problem.
**/
$api_key = "";
$api_sec = "";
$url = "http://abc.com/programs/1";
// Method specific options
@gayanhewa
gayanhewa / .vimrc
Last active August 29, 2015 14:20 — forked from JeffreyWay/.vimrc
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
@gayanhewa
gayanhewa / cracking.md
Last active August 29, 2015 14:27 — forked from vertexclique/cracking.md
Cracking guide for Sublime Text 3 Build 3059 / 3065 ( Mac / Win x86_64 / Windows x86 / Linux x64 / Linux x86 )

MacOS

Build 3059

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to: Sublime Text

Make it executable with: chmod u+x Sublime\ Text

@gayanhewa
gayanhewa / config.xml
Created September 19, 2012 04:49
Magent extention : Working config.xml file with custom table
<config>
<modules>
<Sample_Socialmedia>
<version>0.0.1</version>
</Sample_Socialmedia>
</modules>
<frontend>
<routers>
<socailpromo>
<use>standard</use>
@gayanhewa
gayanhewa / iterm2-solarized.md
Created November 16, 2015 07:30 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OSX)

Solarized

@gayanhewa
gayanhewa / pedantically_commented_playbook.yml
Created December 4, 2015 05:46 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
default:
extensions:
Behat\MinkExtension:
base_url: http://adam-bdd-with-behat.ngrok.io
goutte: ~
selenium2: ~
suites:
default:
contexts:
@gayanhewa
gayanhewa / gist:8bfafa23e97f2114f478
Last active October 18, 2016 06:06 — forked from jagregory/gist:710671
Git Forks
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork git@github...my-fork.git