Skip to content

Instantly share code, notes, and snippets.

@hashg
hashg / components.chat-box.js
Created January 26, 2017 08:14 — forked from samselikoff/components.chat-box.js
Sticky Chatbox - Ember In Viewport
import Ember from 'ember';
export default Ember.Component.extend({
classNames: 'chat-box',
didRender() {
if (this.get('isScrolledToBottom')) {
this.$('ul')[0].scrollTop = this.$('ul')[0].scrollHeight;
}
@hashg
hashg / 0.Jivamrutham.md
Last active January 16, 2019 11:51
ZBNF

Jiwamrita

Yield: 1 Acre | Time: 72hrs | Expires: 7days

Ingredients

  • 200 Ltrs water drum or cement tank.
  • 200 Ltrs of water
  • 10 Kg of indigenous desi Cow Dung
  • 5 to 10 Ltrs of indigenous desi cow urine
  • 1 Kg of black jaggery(smashed)
{
"C6F99": {
"downlinkData": "1"
},
"C6F19": {
"downlinkData": "0"
}
}
@hashg
hashg / gist:c9a5fcc9a85795b969c6
Last active August 29, 2015 14:06 — forked from marbemac/gist:06c5040e4d71694f07b3
Ember Data serializer example
// API return format is as so:
// {
// data: [
// {
// name: 'foo'
// },
// {
// name: 'bar'
// }
// ]
@hashg
hashg / index.html
Last active August 29, 2015 14:02
D3 Linear calendar
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
@hashg
hashg / index.html
Created November 20, 2013 01:33 — forked from bunkat/index.html
<!--
The MIT License (MIT)
Copyright (c) 2013 [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@hashg
hashg / EM_belongsTo.js
Created September 8, 2013 17:28
Ember Model. Adding BelongsTo.
App.Person = Ember.Model.extend({
id: Ember.attr(),
name: Ember.attr(),
addresses: Ember.hasMany(App.Address, {key: 'addresses'})
});
App.Address = Ember.Model.extend({
id: Ember.attr(),
street: Ember.attr(),
person_id: Ember.attr(),
function Routes() {
this.resource('register', {path: '/register'});
this.resource('login', {path: '/login'});
this.resource('logout', {path: '/logout'});
this.resource('projects', {path: 'projects'}, function(){
this.route('new', {path: '/new'});
});
this.resource('project', {path: 'projects/:project_id'}, function(){
this.route('edit', {path: '/edit'});
app/routes.js
function Routes() {
this.resource('register', {path: '/register'});
this.resource('login', {path: '/login'});
this.resource('logout', {path: '/logout'});
this.resource('projects', {path: '/projects'});
this.resource('projectsNew', {path: '/projects/new'});
this.resource('project', {path: '/projects/:project_id'});
this.resource('projectEdit', {path: '/projects/:project_id/edit'});
@hashg
hashg / PersonComputerModel.js
Created July 24, 2013 17:25
Ember Model : Person/Computers
var attr = Ember.attr, hasMany = Ember.hasMany, belongsTo = Ember.belongsTo;
var apiPrefix = '/api';
App.CustomAdapter = Ember.RESTAdapter.extend({
generateIdForRecord: function(record) {
var ch = "abcdefghiklmnopqrstuvwxyz"[Math.floor(25 * Math.random())];
return ch+'xxxyxxx'.replace(/[xy]/g, function(c) {
var r, v;
r = Math.random() * 16 | 0;
v = c === 'x' ? r : r & 0x3 | 0x8;