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");
<?php
use Aws\Common\Aws;
use Aws\S3\Exception\S3Exception;
// make sure the SDK is installed
// I've used Composer to autoload it: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/installation.html
/*
* jQuery File Upload Plugin PHP Class 7.1.0
* https://github.com/blueimp/jQuery-File-Upload
<?php
###################################################################################################
# READING A VALUE FROM YOUR "DEFAULT" CREDENTIAL SET
CFCredentials::get()->key # my-key
CFCredentials::get()->secret # my-secret
CFCredentials::get()->default_cache_config # apc
CFCredentials::get()->certificate_authority # false
// This is exactly the same as specifying "@default"...
--- production/lib/requestcore/requestcore.class.php 2011-04-05 15:56:58.000000000 -0700
+++ development/lib/requestcore/requestcore.class.php 2011-04-21 16:28:40.000000000 -0700
@@ -590,39 +590,44 @@
* @return resource The handle for the cURL object.
*/
public function prep_request()
{
$curl_handle = curl_init();
// Set default options.
// Example Use
(function () {
function success() {
console.log("success: ", this.src);
}
function failure() {
console.log("failure: ", this.src);
}
@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();