Skip to content

Instantly share code, notes, and snippets.

View vigikaran's full-sized avatar
🎯
All the tools are out there and the only thing that limits us is our imagination

Vigikaran vigikaran

🎯
All the tools are out there and the only thing that limits us is our imagination
View GitHub Profile
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC3yn4CdBBKWFkooN/I7rBNuTtE9xmnkAR9/jvfW/h/kieRr/+Pl1dmr6l2mjIX1KrxDGT4LuUAhaa0bXNJAVnb22XqUW3zY6PrcfYs3U8SR1BUYYEMaZkNemxFLGMQuHqXdHTJj98xiCC7TlVT5gCBw6BeqqR4UKG6/2tKau8yf2PJaM8+kzuPn0wLkshxsMY9U4bU/l3raB1dCmHSQ6yxHljFqK2CZP7z+4p240Hkl8GH3rdlLBwscbUvNBTZZEbCr5HQRq543+SUtojju8DfG1hQqxkK89vy960lgntsYp9TEo16EgLGD3jgDlRBo9OVCkBe1KI4X9dStD3hIfGBC1VoUZ6B+X5V35ezJWWlFSsIqI7gdFXIs23qWzhqVEj86u/ukU1LBj1Q68WTk93sqPXUuxVjCgkgjwIVzGbSXuS7h35nWJh3CK2aGfL4w6xswRbKuxZpE4tzqBkLb+mcLQxQUkRyUO++ajpu2cb68h3lmRTXv4La5I6kybnXaOCOpNZOPvn1IBEsG85inlYGktlQir38toW9chiMkzc1UXvxAIDKwFJ2TbxQR4OMRhhnmFw/df+HyPChJYppFVJ4IQS2ipQ8YjdmKDgtzhxAOHxFzSeSQb2yszKDuQl2eIkQy/0LmgdAd13aRruQ2B6GBjlLNpeKpwnhqOQTbagoow== vigikaran
<?php
// Make a MySQL Connection
mysql_connect("host", "user", "password") or die(mysql_error());
mysql_select_db("database") or die(mysql_error());
// Get all the data from the "example" table
$result = mysql_query("SELECT * FROM news LIMIT 5")
or die(mysql_error());
echo "<table border='1'>";
@vigikaran
vigikaran / gist:d138cdcef3881cbc82c1cb71cac8b8d6
Created June 24, 2016 13:08 — forked from wolthers/gist:9227398
Handlebars helper for converting unix timestamp in seconds to pretty date - "25 seconds ago" / "3 minutes ago" / "2 hours ago" / "2 days ago" / "December 25"
/**
@param {UNIX timestamp} timestamp - an unix timestamp in seconds
*/
Handlebars.registerHelper("prettyDate", function (timestamp) {
var date,
monthNames,
secs = ((new Date()).getTime() / 1000) - timestamp,
minutes = secs / 60,
hours = minutes / 60,
(SELECT `source`.`hindi_news_sys_id` AS `news_sys_id`,
`source`.`hindi_news_sys_ownerid` AS `news_sys_ownerid`
,
`source`.`hindi_news_title` AS
`news_title`,
`source`.`hindi_news_labelid` AS `news_labelid`,
Unix_timestamp(source.hindi_news_publish_datetime) AS
news_publish_datetime,
Unix_timestamp(source.hindi_news_sys_created) AS news_sys_created,
`source`.`hindi_news_authorid` AS `news_authorid`,
@vigikaran
vigikaran / 2) Config
Last active July 16, 2016 22:50 — forked from nghuuphuoc/1) Install
Install Redis on Centos 6
$ sudo nano /etc/sysctl.conf
vm.overcommit_memory=1
$ sysctl vm.overcommit_memory=1
$ sysctl -w fs.file-max=100000
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Image Radio Buton</title>
<style>
.cc-selector input{
margin:0;padding:0;
-webkit-appearance:none;
-moz-appearance:none;
<script>
// Load GPT
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function(){
var gads = document.createElement('script');
gads.async = true;
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
server {
listen 80;
root /usr/share/nginx/www;
index index.php index.html index.htm;
server_name example.com;
location / {

Coding Style Guide

This guide extends and expands on [PSR-1], the basic coding standard.

The intent of this guide is to reduce cognitive friction when scanning code from different authors. It does so by enumerating a shared set of rules and expectations about how to format PHP code.

The style rules herein are derived from commonalities among the various member

# Adding SFTP-only user to Ubuntu Server
To add a SFTP-only user, you'll need to make sure your SSH config settings are correct, add a new user/group and set permissions for your new user. For step-by-step directions, see below. Omit `sudo` if you're logged in as root.
### Directions
1. Edit `/etc/ssh/sshd_config` and make sure to add the following at the end of the file:
Match group filetransfer
ChrootDirectory %h