Skip to content

Instantly share code, notes, and snippets.

@sachintaware
sachintaware / SpringSTSCheatSheet.java
Created September 15, 2018 08:26 — forked from elevenrax/SpringSTSCheatSheet.java
Spring STS Cheat Sheet
/**
* Controller Class
* Contains Mappings and HTTP Methods
*/
@RestController
public class TopicController {
@Autowired
private TopicService topicService;
@sachintaware
sachintaware / .htaccess
Created February 3, 2018 19:17 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@sachintaware
sachintaware / zsh.md
Created September 26, 2016 07:01 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
@sachintaware
sachintaware / gist:a08d2a8f1563a7e00ea6532800a087ab
Created July 1, 2016 07:32 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@sachintaware
sachintaware / gist:b343254940da0161e0f2
Created January 17, 2016 04:56 — forked from bateller/gist:154c6e5d1f6e0e53e527
Stripe Example (Works with v2 of Stripe-PHP)
<?php
// Edited boucher/gist:1750375 to work with stripe-php v2
require 'stripe-php/init.php';
if ($_POST) {
\Stripe\Stripe::setApiKey("YOUR-API-KEY");
$error = '';
$success = '';
try {
if (!isset($_POST['stripeToken']))
throw new Exception("The Stripe Token was not generated correctly");
@sachintaware
sachintaware / GetLatLong.js
Created September 25, 2015 05:23 — forked from BastinRobin/GetLatLong.js
Get Latitude And Longitude Javascript Function
/* Get the latitude and longitude from address:
Author : Bastin Robins J
*/
// Add the link to webpage
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
//Function to covert address to Latitude and Longitude
var getLocation = function(address) {
var geocoder = new google.maps.Geocoder();
@sachintaware
sachintaware / .bash_profile
Last active August 29, 2015 14:28 — forked from JeffreyWay/.bash_profile
Prettier git logs
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
<?php namespace App\Services;
use App\User;
class AclPermitted
{
public static function verify( $permission )
{
/** @var User $user */
$user = app( 'auth' )->user();

Note: Some of these shortcuts have been remapped for my own convenience (Preferences->Keymap). These are Mac shortcuts, just use the Windows/Linux equivalent of the Cmd/Option/Ctrl/Del keys.

####Search, Go to, Navigation ####

Cmd + P - Search file

Cmd + Shift + O - Search everywhere

(I swapped the above two recently because I use Cmd + P to search for files most of the time).

<?php namespace App\Services;
use App\User;
class AclPermitted
{
public static function verify( $permission )
{
/** @var User $user */
$user = app( 'auth' )->user();