Skip to content

Instantly share code, notes, and snippets.

@roopunk
roopunk / style
Created March 24, 2012 05:43
CSS for the sharebox example at metageeks
*
{
font-family:arial;
border:none;
outline:none;
font-size:10pt;
}
#submit /* the button */
{
padding:8px;
@roopunk
roopunk / README.md
Last active August 29, 2015 14:17 — forked from mikedfunk/README.md

This uses Twitter Bootstrap classes for CodeIgniter pagination.

Drop this file into application/config.

@roopunk
roopunk / .env
Last active March 8, 2018 17:44
Codeigniter Hook for integrating phpdotenv extension by vlucas
DB_HOST="localhost"
DB_USER="root"
DB_PASS="admin123"
@roopunk
roopunk / composer.json
Created January 26, 2016 13:53
composer.json for Codeigniter Hook for integrating phpdotenv extension by vlucas
{
"require": {
"vlucas/phpdotenv": "^2.2"
}
}
@roopunk
roopunk / hooks.php
Created January 26, 2016 13:53
hooks.php for Codeigniter Hook for integrating phpdotenv extension by vlucas Raw
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Hooks
| -------------------------------------------------------------------------
| This file lets you define "hooks" to extend CI without hacking the core
| files. Please see the user guide for info:
|
| http://codeigniter.com/user_guide/general/hooks.html
|
@roopunk
roopunk / composer_global_install.sh
Created July 11, 2017 04:00
Installing composer globally in a linux system.
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
php -r "unlink('composer-setup.php');"
@roopunk
roopunk / q1.c
Created February 14, 2019 05:19
DTU assessment. CS Q1
int j = 0;
for(int i=0;i<n; ++i){
while(j<n && arr[i]<arr[j]) {
j++;
}
}
@roopunk
roopunk / q2.cpp
Created February 14, 2019 05:27
DTU assessment CS Q2
int findLeastDistance(vector<vector<int>> &A, int i, int j){
int I = A.size();
int J = A[0].size();
if (i >= I || j >= J) return Integer_Max //Infinity
if (i == I - 1 && j == J - 1) return 0;
return A[i][j] + min(findLeastDistance(A, i+1, j), findLeastDistance(A,i, j+1));
}
@roopunk
roopunk / q3.cpp
Created February 14, 2019 05:29
DTU assessment CS Q3
#include <iostream>
using std::cout;
int main()
{
int i = 0;
cout << (i = 0 ? 1 : 2 ? 3 : 4);
return 0;
}
@roopunk
roopunk / q4.cpp
Created February 14, 2019 05:30
DTU assessment CS Q4
#include <iostream>
using namespace std;
int main()
{
int x = 0;
x = printf("Engifest 2k19!");
printf(" %d", x);
return 0;
}