Skip to content

Instantly share code, notes, and snippets.

View gangadharjannu's full-sized avatar
🎯
Focusing

Gangadhar gangadharjannu

🎯
Focusing
  • Amsterdam
View GitHub Profile
@subtubes-io
subtubes-io / Array.prototype methods
Created April 17, 2014 04:03
A suite of jasmine tests for the Array.prototype methods.
(function () {
describe("Array", function () {
it("Array reverse()", function () {
expect("sgniht").toBe("things".split("").reverse().join(""));
});
it("Array sort()", function () {
import { Injectable } from '@angular/core';
import { async, inject, TestBed } from '@angular/core/testing';
import { MockBackend, MockConnection } from '@angular/http/testing';
import {
Http, HttpModule, XHRBackend, ResponseOptions,
Response, BaseRequestOptions
} from '@angular/http';
@Injectable()
class MetaManager {}
@leifoolsen
leifoolsen / polymer-1.0-create-custom-element.md
Last active March 9, 2018 19:53
Polymer 1.0 : Custom elements

Polymer 1.0 : Custom elements

Simplest possible workflow

Minimal steps required to create a custom elemenet in Polymer 1.0, without any aid from tools like Yeoman and Gulp.

I have used the Quick tour of Polymer as a reference.

Prerequisites

@tantaman
tantaman / polymer-requirejs
Last active April 5, 2018 07:29
polymer + requirejs : originally by Scott Miles from: http://jsbin.com/efojap/2/edit
<!doctype html>
<html>
<head>
<title>Polymer and RequireJS</title>
<script src="http://polymer.github.io/cdn/polymer.min.js"></script>
</head>
<body>
<!-- #foo -->
<div id="foo">the foo has no joy.</div>
@dahngeek
dahngeek / wdio-phantomjs-proxy.js
Last active May 24, 2018 12:06
Running a PhantomJS driver with webdriver.io using an http proxy. Or with authentication.
capabilities: [
{ browserName: 'phantomjs',
"phantomjs.page.settings.userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.1.54 (KHTML, like Gecko) Version/9.0 Safari/601.1.54",
"proxy": {
"proxyType":"MANUAL",
"httpProxy":"HOST:PORT"
}
}
]
@christian-bromann
christian-bromann / webdriverio.js
Created September 24, 2014 16:02
chromeoptions in webdriverio
var client = require("webdriverio").remote({
desiredCapabilities: {
browserName: 'chrome',
chromeOptions: {
args: ['window-size=2880,1800']
}
}
})
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
<link rel="import" href="../../bower_components/paper-input/paper-input.html">
<dom-module id="ajax-multiple">
<template>
<section id="content">
<paper-input id="post" label="Post" value="{{title}}" on-blur="resolve">
</paper-input>
@elijahmanor
elijahmanor / fake-server-unit-test.js
Last active August 28, 2018 09:23
Unit Test like a Secret Agent with Sinon.js
describe("getTweets - Server", function () {
var server, fakeData = [ /* ... */ ];
before(function () {
// Doesn’t work :( It’s JSONP!
server = sinon.fakeServer.create();
server.respondWith(
"GET",
"https://api.twitter.com/.../elijahmanor.json?count=5",
[200, { "Content-Type": "application/json" }, JSON.stringify(fakeData)]
@Vorda
Vorda / kendo-checkboxes-grid.html
Created June 30, 2013 21:03
This example demonstrates how to select grid rows using checkboxes, preserve that selection between pages, get selected item IDs from all pages.
<!DOCTYPE html>
<html>
<head>
<link href="http://cdn.kendostatic.com/2013.1.514/styles/kendo.common.min.css" rel="stylesheet" type="text/css" />
<link href="http://cdn.kendostatic.com/2013.1.514/styles/kendo.default.min.css" rel="stylesheet" type="text/css" />
<script src="http://cdn.kendostatic.com/2013.1.514/js/jquery.min.js"></script>
<script src="http://cdn.kendostatic.com/2013.1.514/js/kendo.all.min.js"></script>
</head>
<body>
@mattdesl
mattdesl / about.md
Last active August 9, 2019 13:21
fast & optimized browserify builds

Small script for development + builds with browserify.

Uses loose-envify for faster inlining and cross-env to handle windows/unix shells.

Dev features:

  • fast rebuilds w/ watchify, LiveReload, syntax errors in DOM, etc.

Build features:

  • uglify, simple dead code elimination, optimized bundle.