Skip to content

Instantly share code, notes, and snippets.

View tohansg's full-sized avatar

Gurinder Hans tohansg

View GitHub Profile
@tohansg
tohansg / 0x18830f969Dc869e2536C7357dfe2CD057ff843Fd
Created October 17, 2017 21:03
0x18830f969Dc869e2536C7357dfe2CD057ff843Fd
0x18830f969Dc869e2536C7357dfe2CD057ff843Fd

Keybase proof

I hereby claim:

  • I am gurinderhans on github.
  • I am gurinderhans (https://keybase.io/gurinderhans) on keybase.
  • I have a public key whose fingerprint is 9440 4AE4 6B4C E869 EA70 9F7B 8E79 EB3A 9BC0 8334

To claim this, I am signing this object:

/// "vector.c"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "vector.h"
void vector_init(vector *v)
{
@tohansg
tohansg / opencv.py
Last active August 29, 2015 14:13 — forked from cooncesean/opencv.py
import cv
CAMERA_INDEX = 0
# CODEC = cv.CV_FOURCC('D','I','V','3') # MPEG 4.3
# CODEC = cv.CV_FOURCC('M','P','4','2') # MPEG 4.2
# CODEC = cv.CV_FOURCC('M','J','P','G') # Motion Jpeg
# CODEC = cv.CV_FOURCC('U','2','6','3') # H263
# CODEC = cv.CV_FOURCC('I','2','6','3') # H263I
# CODEC = cv.CV_FOURCC('F','L','V','1') # FLV
# .bashrc file for PS1 customzation
export PS1='\[\e[1;34m\][\u@\h \W]\$\[\e[0m\] '
# file /etc/motd - change to whatever wanted
M[16],X=16,W,k;main(){T(system("stty cbreak")
);puts(W&1?"WIN":"LOSE");}K[]={2,3,1};s(f,d,i
,j,l,P){for(i=4;i--;)for(j=k=l=0;k<4;)j<4?P=M
[w(d,i,j++)],W|=P>>11,l*P&&(f?M[w(d,i,k)]=l<<
(l==P):0,k++),l=l?P?l-P?P:0:l:P:(f?M[w(d,i,k)
]=l:0,++k,W|=2*!l,l=0);}w(d,i,j){return d?w(d
-1,j,3-i):4*i+j;}T(i){for(i=X+rand()%X;M[i%X]
*i;i--);i?M[i%X]=2<<rand()%2:0;for(W=i=0;i<4;
)s(0,i++);for(i=X,puts("\e[2J\e[H");i--;i%4||
puts(""))printf(M[i]?"%4d|":" |",M[i]);W-2
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// A console to display Unity's debug logs in-game.
/// </summary>
public class Console : MonoBehaviour
{
struct Log
{
@tohansg
tohansg / mail.php
Created March 18, 2014 21:50
PHP mail() function
<?php
if(isset($_POST["email"]) && !empty($_POST["email"])){
//if(!$_POST) exit;
$email = $_POST['email'];
$name = $_POST['name'];
$comments = $_POST['comments'];
@tohansg
tohansg / dabblet.css
Created February 16, 2014 16:23
Simple <table> styling
table{
font-family:Courier;
}
th{
background:#BADA55;
padding:40px;
box-sizing:border-box;
}
tr{
background:lightblue;
@tohansg
tohansg / dabblet.css
Created February 16, 2014 08:34
Untitled
#div1
{
position: relative;
height: 200px;
width: 200px;
margin: 50px;
padding:10px;
border: 1px solid black;
}