Skip to content

Instantly share code, notes, and snippets.

View archit's full-sized avatar
🏠
Working from home

Archit Baweja archit

🏠
Working from home
View GitHub Profile
@archit
archit / kill-heroku-app.sh
Created November 20, 2013 18:36
Kill all heroku dynos for a an app.
heroku ps -a$1 | awk '/===/ {print $2}' | xargs -L1 -I % heroku ps:scale %=0
@archit
archit / test-helper.js
Created April 2, 2015 15:27
How to run ember-cli > v0.2.x acceptance tests to run on CircleCI
import resolver from './helpers/resolver';
import {
setResolver
} from 'ember-qunit';
setResolver(resolver);
// Since CircleCI runs with PhantomJS 1.9.x, need this to make things
// green!
if (!Function.prototype.bind) {
<h3>Hello Express</h3>
<script src="https://cdn.socket.io/socket.io-1.3.5.js"></script>
<script>
var socket = io.connect('http://localhost:3000', {
reconnection: false,
reconnectionAttempts: 5
});
socket.on('news', function (data) {
console.log(data);
import Ember from 'ember';
import {
moduleForModel,
test
} from 'ember-qunit';
moduleForModel('experiment');
test("cloneAsNew: creates a new unsaved model", function(assert) {
var model = this.subject();
Router.map(function() {
this.route('emulate', { path: '/emulate' }, function() {
this.route('show', { path: '/:my_model_id' });
});
});
export default Ember.Route.extend({
model: function(params) {
if (params.my_model_id) {
return this.store.find("my-model", params.my_model_id);
@archit
archit / circle.yml
Created June 23, 2015 17:24
CircleCI config for generating code coverage report in a NodeJS project
dependencies:
pre:
- npm install -g istanbul
general:
artifacts:
- ./coverage
@archit
archit / gist:82f387eb08d888a873b3
Created August 11, 2015 23:04
Determine latest release of a github repo in ansible task
tasks:
- name: find release
uri: url=https://api.github.com/repos/{{ org_name }}/{{ repo_name }}/releases/{{ release_version }}
user={{ auth_user }}
password=x-oauth-basic
force_basic_auth=yes
return_content=yes
register: github
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "*",
"Resource": "*"
}
]
}
Looks like AWS is down again:
EC2ResponseError: 401 Unauthorized
<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>AuthFailure</Code><Message>AWS was not able to validate the provided access credentials</Message></Error></Errors><RequestID>f2a2bccd-2150-4e41-bcf3-7577e2ce1e00</RequestID></Response>
archit@ip-10-0-0-10:~/provisioning/hosts/production$
import Ember from 'ember';
export default Ember.Component.extend({
mouseDown() {
this.get("cry")();
}
});