Skip to content

Instantly share code, notes, and snippets.

View vamshisuram's full-sized avatar
🎯
Focusing

Vamshi Suram vamshisuram

🎯
Focusing
View GitHub Profile
@vamshisuram
vamshisuram / css_tips
Last active August 29, 2015 14:06
simple-gists
/*
working with floats
apply additional class on the floats' parent
*/
.clearfix:after {
content: ".";
visibility: hidden;
display: block;
height: 0;
clear: both;
@vamshisuram
vamshisuram / js_coding_standards
Last active August 29, 2015 14:07
js coding standards
Indentation - 2 spaces (tabs converted to spaces)
Line length - 80
comments up-to-date
block comments for documentation; typical - line comments
var variable; (each variable in a new declaration)
// named functions - mind the spaces; alignment of curly braces
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
var promise = {
@vamshisuram
vamshisuram / injectServiceMocks
Created December 19, 2014 12:09
Injecting service(factory) mocks inside other services(factory) in Angularjs-Jasmine tests
// Feel free to mention if something is wrong. :)
describe('Service-1 tests', function() {
var Service1, Service2;
var Service2-Mock = {
// some object data/methods
};
beforeEach(function () {
@vamshisuram
vamshisuram / atom-editor-shortcuts
Last active August 29, 2015 14:11
Atom Editor Shortcuts - windows keyboard
// I frequently use.
alt - to open/hide menu bar
ctrl + \ - toggle dir view
ctrl + w - close tab
ctrl + p - fuzzy finder for file
ctrl + 0 - open and focus the the tree view.
ctrl + shift + p - command pallette
ctrl + , - open atom editor settings
<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
// sorting - trial 2
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script src="http://jashkenas.github.io/underscore/underscore-min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<script src="http://code.ionicframework.com/1.0.0-beta.13/js/ionic.bundle.min.js"></script>
<link href="http://code.ionicframework.com/1.0.0-beta.13/css/ionic.min.css" rel="stylesheet" type="text/css" />
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
body * {
color: rgba(0,0,0,0.45);
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"