Skip to content

Instantly share code, notes, and snippets.

@ravasthi
ravasthi / actual-indentation.jsx
Created October 9, 2016 13:26
Indentation samples
/*
** Indented using the TM command 'Indent Selection' (opt + cmd + [)
*/
import BodyClassName from 'react-body-classname';
import DocumentTitle from 'react-document-title';
import generateDocumentTitle from 'components/lib/pageDisplay';
import React from 'react';
function MyComponent() {
const componentClass = 'my-component';
@ravasthi
ravasthi / .eslintrc.json
Last active May 2, 2018 03:06
eslint-plugin-import issue 238 configuration
{
"parser": "babel-eslint",
"extends": "airbnb",
"plugins": [
"babel",
"import",
"react"
],
"rules": {
"indent": ["error", 4],
require 'formula'
class Macvim < Formula
homepage 'http://code.google.com/p/macvim/'
url 'https://github.com/b4winckler/macvim/tarball/snapshot-66'
version '7.3-66'
sha1 'd11696f7089688fa96a45fc57410c60f6ca5a394'
head 'https://github.com/b4winckler/macvim.git', :branch => 'master'
@ravasthi
ravasthi / loadFixture.js
Last active January 3, 2016 14:49 — forked from mavenlink/loadFixture.js
Update original to use jQuery.ajax instead of jasmine.XmlHttpRequest. It should play better with jasmine 2.0.
var uniqueLoadIndicator = null;
// Loads fixure markup into the DOM as a child of the jasmine_content div
spec.loadFixture = function(fixtureName) {
var $destination = $('#jasmine_content');
uniqueLoadIndicator = null;
var indicatorScript = "<script>uniqueLoadIndicator = 'loaded';</s" + "cript>";
// get the markup, inject it into the dom
$destination.html(spec.fixtureHtml(fixtureName) + indicatorScript);
@ravasthi
ravasthi / index.html
Created February 6, 2013 17:16
The story thus far…
<!DOCTYPE html>
<html>
<head>
<style type="text/css" media="screen">
h1
{
color: midnightBlue;
}
p.important
@ravasthi
ravasthi / postmore.rb
Created February 15, 2012 20:09
Adding "read more" to Jekyll
module Jekyll
module PostMore
def postmorefilter(input, url, text)
m = /(?<morestring><!--\s*more\s*-->)/.match(input)
if m
input.split(m[:morestring]).first + "<p class=\"more\"><a href=\"#{url}\">#{text}</a></p>"
else
input
end
end
@ravasthi
ravasthi / _config.yml
Created February 15, 2012 08:59
Multiple authors on Jekyll
authors:
hanzou:
name: Hanzou Hattori
display_name: Hanzou
gravatar: c66919cb194f96c696c1da0c47354a6a
email: hanzou@company.com
web: http://company.com
twitter: company
github: hhattori
jorgen:
@ravasthi
ravasthi / Rakefile
Created February 14, 2012 19:30
Jekyll Rakefile modifications
require "rubygems"
require "rake"
require "fileutils"
SOURCE = "."
CONFIG = {
'themes' => File.join(SOURCE, "_includes", "themes"),
'layouts' => File.join(SOURCE, "_layouts"),
'posts' => File.join(SOURCE, "_posts"),
'post_ext' => "md"
@ravasthi
ravasthi / favicon.html
Created January 7, 2012 17:53
Favicon code
<!-- Favicons and touch icons -->
<!-- For retina-display iPads -->
<link href="/assets/images/apple-touch-icon-xlarge.png" rel="apple-touch-icon-precomposed" sizes="144x144" type="image/png"/>
<!-- For retina-display iPhones -->
<link href="/assets/images/apple-touch-icon-large.png" rel="apple-touch-icon-precomposed" sizes="114x114" type="image/png"/>
<!-- For iPad 1 -->
<link href="/assets/images/apple-touch-icon-medium.png" rel="apple-touch-icon-precomposed" sizes="72x72" type="image/png"/>
<!-- For iPhone 3G, iPod Touch and Android -->
<link href="/assets/images/apple-touch-icon-small.png" rel="apple-touch-icon-precomposed" type="image/png"/>
<!-- For Nokia -->
@ravasthi
ravasthi / markup.html
Created December 6, 2011 23:33
Add retina graphics to your website
<div id="page">
<header>
<a class="home" href="/"><div class="logo">&nbsp;</div></a>
<nav>
<a class="gallery" href="gallery.html">Gallery</a>
<a class="pricing" href="pricing.html">Pricing</a>
<a class="contact" href="mailto:hello@mycompany.com">Contact</a>
</nav>
</header>
</div> <!-- /#page -->