Skip to content

Instantly share code, notes, and snippets.

View pvmsikrsna's full-sized avatar

pvmsikrsna

  • Hyderabad, India
View GitHub Profile
@pvmsikrsna
pvmsikrsna / ImplicitSenderTest.scala
Created September 8, 2018 18:05 — forked from mguillermin/ImplicitSenderTest.scala
Sample showing basic usage of Akka TestKit and TestActorRef
package sample.akka.testkit
import akka.actor.ActorSystem
import akka.actor.Actor
import akka.testkit.{TestKit, TestActorRef}
import org.scalatest.matchers.MustMatchers
import org.scalatest.WordSpec
class ImplicitSenderTest extends TestKit(ActorSystem("testSystem"))
// Using the ImplicitSender trait will automatically set `testActor` as the sender
@pvmsikrsna
pvmsikrsna / gist:85f0cac6c8149a7a508ad98f5f396cc4
Created August 4, 2018 08:49 — forked from freyes/gist:dfc3f5232526a62bbc09adc816e0477d
bluetoothd: a2dp-sink profile connect failed for AA:BB:CC:DD:EE:00: Protocol not available
Source: https://g751jy.wordpress.com/about/parrot-zik-bluetooth-headset/
https://bbs.archlinux.org/viewtopic.php?id=194006
Cached: http://webcache.googleusercontent.com/search?q=cache:4stTobIXSD0J:https://g751jy.wordpress.com/about/parrot-zik-bluetooth-headset/+&cd=3&hl=en&ct=clnk&gl=us
Bug and possible solution: actually I found a bug in that make the headset unusable, it seems that the pulse audio module: module-bluetooth-discover works only if started after the X11 session is up. So I have a workaround.
Edit the file:
/etc/pulse/default.pa
@pvmsikrsna
pvmsikrsna / gist:3d24518195eeb318edf701dd7050eb54
Created June 23, 2018 10:49 — forked from mrtns/gist:78d15e3263b2f6a231fe
Upgrade Chrome from Command Line on Ubuntu
# Install
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Update
@pvmsikrsna
pvmsikrsna / nginx.conf
Created January 6, 2018 06:18 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@pvmsikrsna
pvmsikrsna / README.md
Created August 17, 2017 07:18 — forked from bergie/README.md
Backbone.js Collection View example

This is an example of using a Collection view with Backbone.

@pvmsikrsna
pvmsikrsna / angularjs-providers-explained.md
Created January 7, 2017 11:19 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@pvmsikrsna
pvmsikrsna / ba-smallwalker.js
Created December 31, 2016 11:11 — forked from cowboy/ba-smallwalker.js
Small Walker: A small and simple JavaScript DOM walker
/*!
* Small Walker - v0.1.1 - 5/5/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
// Walk the DOM, depth-first (HTML order). Inside the callback, `this` is the
@pvmsikrsna
pvmsikrsna / README.md
Created December 29, 2016 12:28 — forked from inklesspen/README.md
Fast and flexible unit tests with live Postgres databases and fixtures

(This gist is pretty old; I've written up my current approach to the Pyramid integration on this blog post, but that blog post doesn't go into the transactional management, so you may still find this useful.)

Fast and flexible unit tests with live Postgres databases and fixtures

I've created a Pyramid scaffold which integrates Alembic, a migration tool, with the standard SQLAlchemy scaffold. (It also configures the Mako template system, because I prefer Mako.)

I am also using PostgreSQL for my database. PostgreSQL supports nested transactions. This means I can setup the tables at the beginning of the test session, then start a transaction before each test happens and roll it back after the test; in turn, this means my tests operate in the same environment I expect to use in production, but they are also fast.

I based my approach on [sontek's blog post](http://sontek.net/blog/

@pvmsikrsna
pvmsikrsna / Converting libraries to Ember CLI addons.md
Created December 16, 2016 19:25 — forked from kristianmandrup/Converting libraries to Ember CLI addons.md
Guide to Developing Addons and Blueprints for Ember CLI

Converting libraries to Ember CLI addons

In this guide we will cover two main cases:

  • Ember specific library
  • vendor library

Ember library

The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.

@pvmsikrsna
pvmsikrsna / 00-about-search-api-examples.md
Created November 29, 2016 20:16 — forked from jasonrudolph/00-about-search-api-examples.md
5 entertaining things you can find with the GitHub Search API