Skip to content

Instantly share code, notes, and snippets.

View roshangautam's full-sized avatar
🎯
Focusing

Roshan Gautam roshangautam

🎯
Focusing
View GitHub Profile
@roshangautam
roshangautam / textfield.js
Last active November 18, 2023 19:30
Override Default textfield.js to remove is-invalid by default for required textfields.
(function() {
'use strict';
MaterialTextfield = window['MaterialTextfield'];
/**
* Handle lost focus.
*
* @private
*/
<?php
// Rules for Laravel Code Standard
$rules = [
'@PSR2' => true,
// PHP arrays should be declared using the configured syntax.
'array_syntax' => [
'syntax' => 'short', //whether to use the long or short array syntax;
],
@roshangautam
roshangautam / macosx-install-php-oracle-oci8.md
Created June 26, 2017 17:20 — forked from gido/macosx-install-php-oracle-oci8.md
install Oracle PHP Extension (oracle OCI8) - instantclient for Mac OS 10.8 - homebrew environnement

Installation

This procedure is tested on Mac OS X 10.8 with Developpers tools installed (xCode).

PHP 5.4 installed with Homebrew.

Update: I wrote a blog post about this.

Preparation

Download the following files from Oracle website (yes, you need to create an account and accept terms):

@roshangautam
roshangautam / Git Log Alias
Created August 3, 2017 15:57
Git Log Alias
alias gll="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@roshangautam
roshangautam / uikit3.blade.php
Created August 21, 2017 23:28
Laravel 5 Pagination - UIKit 3
@if ($paginator->hasPages())
<ul class="uk-pagination">
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<li class="uk-disabled"><span>&laquo;</span></li>
@else
<li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">&laquo;</a></li>
@endif
{{-- Pagination Elements --}}
@roshangautam
roshangautam / topn.cpp
Created September 10, 2017 19:32
TopN
#include <iostream>
#include <fstream>
#include <queue>
#include <string>
 
using namespace std;
 
void topn(string file_name, int n) {
  ifstream infile(file_name); // open a pointer to the huge file
  int a;
@roshangautam
roshangautam / quicksort.py
Last active September 25, 2017 01:25
Quick Sort - Python
def quicksort(array, first, last):
if first < last :
pivot = array[first]
left = first + 1
right = last
while 1 :
while left <= right and array[left] <= pivot :
left += 1
while right >= left and array[right] >= pivot :
right -= 1

Keybase proof

I hereby claim:

  • I am roshangautam on github.
  • I am roshangautam (https://keybase.io/roshangautam) on keybase.
  • I have a public key ASDRkwf0V5Dhi2JocA2JeC7QH3JZKBgx6LWJHBdQznYIiQo

To claim this, I am signing this object:

@roshangautam
roshangautam / validator.py
Created March 10, 2018 18:46 — forked from iiska/validator.py
Simple XML Schema validator in Python using lxml library
#! /usr/bin/python
# -*- coding: utf-8 -*-
#
# Simple XML validator done while learning the use of lxml library.
# -- Juhamatti Niemelä <iiska AT iki DOT fi>
import lxml
from lxml import etree
if __name__ == "__main__":
@roshangautam
roshangautam / mbp2011-disable-amd-gpu.md
Created July 3, 2018 15:40 — forked from blackgate/mbp2011-disable-amd-gpu.md
Macbook Pro 2011 - Disable AMD GPU