Skip to content

Instantly share code, notes, and snippets.

View sunitparekh's full-sized avatar

Sunit Parekh sunitparekh

View GitHub Profile
---
name: footer
copyright: "Copyright &copy; 2013 soupCMS, Licensed under <a href=\"http://opensource.org/licenses/mit-license.html\">MIT License.</a>"
links:
-
label: About
link:
url: http://www.soupcms.com/about
-
label: Contact Us
module SoupCMS
module Core
module Recipe
class Inline
def initialize(recipe_hash, page_module)
@recipe_hash = recipe_hash
@page_module = page_module
end
@sunitparekh
sunitparekh / embed_youtube.html
Last active August 29, 2015 14:00
How to add YouTube video to soupCMS markdown?
<iframe
id="ytplayer" type="text/html"
width="768" height="432"
src="//www.youtube.com/embed/U8GBXvdmHT4?html5=1"
frameborder="0" allowfullscreen autohide="1" rel="0"
/>
@sunitparekh
sunitparekh / embed_gist.html
Created April 25, 2014 10:33
How to embed Gist in soupCMS markdown?
<script src="https://gist.github.com/sunitparekh/11284813.js"></script>
@sunitparekh
sunitparekh / google_analytics.html
Last active August 29, 2015 14:00
Google Analytics tracking code
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-12345678-1', 'example.com');
ga('send', 'pageview');
</script>
@sunitparekh
sunitparekh / git-status-multi-repository-shell-scirpt
Last active September 3, 2015 04:39
Shell script to check satus of git repository for multiple projects
#!/bin/bash
repos=(
"/c/projects/project-1"
"/c/projects/project-2"
"/c/projects/project-3"
)
echo ""
echo "Checking" ${#repos[@]} "repositories for status"
@sunitparekh
sunitparekh / git-pull-with-rebase-multi-repository-shell-script
Created September 3, 2015 04:38
Shell script to pull latest code from remote git repository for multiple projects
#!/bin/bash
repos=(
"/c/projects/project-1"
"/c/projects/project-2"
"/c/projects/project-3"
)
echo ""
echo "Getting latest for" ${#repos[@]} "repositories using pull --rebase"
@sunitparekh
sunitparekh / TestMail.java
Last active October 4, 2015 09:27
Sample Email Test using Dumbster
import com.dumbster.smtp.SimpleSmtpServer;
import com.dumbster.smtp.SmtpMessage;
import org.junit.Test;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
public class TestEmail {
@Test
@sunitparekh
sunitparekh / employee.json
Last active April 2, 2018 17:24
JSON Success response
Status: 200
Content-Type: application/json
{
"employeeId":123456,
"firstName": "Sunit",
"lastName": "Parekh",
"gender": "Male",
"hireDate": "2012-01-01",
"birthDate": "1990-01-01",
Status: 404
Content-Type: application/json
{
"code": "NOT_FOUND",
"message": "Oops! Requested employee 123456 not found."
}
Status: 400