Skip to content

Instantly share code, notes, and snippets.

View jayeshcp's full-sized avatar
🏎️

Jayesh Chandrapal jayeshcp

🏎️
View GitHub Profile
@jayeshcp
jayeshcp / FindDuplicates.java
Last active August 29, 2015 14:13
Find duplicate elements in array in O(N) time
/* Find if given array has duplicate elements (more than 1 occurence)
Time Constraint: O(N)
Author: Jayesh CP
*/
import java.util.*;
import java.lang.*;
import java.io.*;
public class FindDuplicates
@jayeshcp
jayeshcp / RegexDemo.java
Created January 7, 2015 15:39
Search for occurrence of string using Pattern and Matcher
import java.util.regex.*;
public class RegexDemo {
public static final String SAMPLE_STRING = "Perfection is not attainable, but if we chase perfection we can catch excellence";
public static void main(String[] args) {
//pattern to compare \\b matches word boundaries, so
//the below pattern only matches we
String searchStr = "we";
Pattern pattern = Pattern.compile("\\b" + searchStr + "\\b");
@jayeshcp
jayeshcp / FileRead.java
Created January 7, 2015 15:37
Reading integers from data file
import java.io.File;
import java.io.FileReader;
import java.io.BufferedReader;
import java.io.IOException;
public class FileRead {
public static void main(String[] args) {
BufferedReader bf = null;
try {
@jayeshcp
jayeshcp / ReadProperties.java
Last active August 11, 2016 16:43
Reading .properties file
/**
* This program reads config.properties file and displays
* all the keys and values
*
* @author Jayesh Chandrapal
* @version 1.0
*/
import java.util.Properties;
import java.io.InputStream;
@jayeshcp
jayeshcp / sublime-preferences.md
Last active September 17, 2016 15:29
Sublime Text User Preferences

In order to install packages, package control needs to be installed. Please refer to https://packagecontrol.io/installation.

{
	"bold_folder_labels": true,
	"caret_style": "phase",
	"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
	"font_size": 15,
	"highlight_color_blue": true,
	"highlight_line": true,
	"highlight_modified_tabs": true,
@jayeshcp
jayeshcp / Chrome_Notification.js
Last active August 29, 2015 13:57
Show popup notification from Chrome Extension
var options = {
type: 'basic',
iconUrl: 'images/app_icon.png',
title: chrome.i18n.getMessage("appName"),
message: chrome.i18n.getMessage("notif_message"), //You haven't made entry to your diary. Want to finish now ?
buttons: [
{
title: chrome.i18n.getMessage("add_now")
}
]
@jayeshcp
jayeshcp / laravel-upload-resize.php
Last active August 29, 2015 13:56 — forked from sineld/laravel-upload-resize.php
Resize uploaded image in Laravel
<?php
// Resizer and Image Manipulation
// Based on: http://forums.laravel.com/viewtopic.php?id=2648
public function post_edit_logo($id)
{
$rules = array(
'image' => 'image',
);
@jayeshcp
jayeshcp / CDN_Links.html
Last active May 22, 2017 12:45
CDN Links
@jayeshcp
jayeshcp / css_resources.md
Last active August 29, 2015 13:56 — forked from jookyboi/css_resources.md
CSS Libraries

CSS Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@jayeshcp
jayeshcp / javascript_resources.md
Last active August 29, 2015 13:56 — forked from jookyboi/javascript_resources.md
Javascript Libraries

Javascript Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, lo