Skip to content

Instantly share code, notes, and snippets.

@SantoshSrinivas79
SantoshSrinivas79 / app.js
Created April 22, 2012 11:24
Learning-Emberjs-Post-1
var App = Em.Application.create();
App.MyView = Em.View.extend({
mouseDown: function() {
window.alert("hello world!");
}
});
@SantoshSrinivas79
SantoshSrinivas79 / app.js
Created April 22, 2012 15:34
Learning-Emberjs-Post-2
// Now trying out the Barack Obama Example from emberjs.com
var MyApp = Ember.Application.create();
MyApp.president = Ember.Object.create({
firstName: "Barack",
lastName: "Obama",
fullName: function() {
return this.get('firstName') + ' ' + this.get('lastName');
@SantoshSrinivas79
SantoshSrinivas79 / app.js
Created April 22, 2012 16:06
Learning-Emberjs-Post-3-Twitter App
// Namespace
Twitter = Em.Application.create({
ready: function() {
// Polling
setInterval(function() {
Twitter.searchResults.refresh();
}, 20000);
Twitter.searchResults.set("query", "Top Charts");
App.Tax = Ember.Object.extend({});
App.taxesController = Ember.ArrayController.create({
content: [
{name:"tax1",rate:"10",number_id:"TaxIDNum"},
{name:"tax2",rate:"9",number_id:null}
],
newTax: function() {
this.pushObject(App.Tax.create({}));
},
@SantoshSrinivas79
SantoshSrinivas79 / nse_indices_final.js
Created June 23, 2012 05:05
Scraping Historical Data of NSE Indices using CasperJS
var casper = require('casper').create({
verbose: true,
logLevel: "debug",
clientScripts: ['includes/jquery-1.7.2.min.js','includes/moment.min.js']
});
var indices = [
"S&P CNX NIFTY",
"S&P CNX 500",
"CNX 100",
@SantoshSrinivas79
SantoshSrinivas79 / new_interest_pyrostream.js
Created August 1, 2012 04:45
Sample for creating a new form using PyroStreams in PyroCMS
{{ streams:form stream="customer_interests" mode="new" return={ pages:url id="9" }​ }}
{{ form_open}}
<table>
{{ fields }}
<tr class="{{ odd_even }}">
<td width="50%">{{ input_title }}{{ required }} <br/><small>{{ instructions }}</small></td>
@SantoshSrinivas79
SantoshSrinivas79 / pyrocms-permissions.sh
Last active August 7, 2022 11:11
Fix PyroCMS File & Folder Permissions All-In-One
sudo chmod -R 777 system/cms/cache
sudo chmod -R 777 system/cms/config
sudo chmod -R 777 addons
sudo chmod -R 777 system/cms/cache
sudo chmod -R 777 uploads
sudo chmod -R 666 system/cms/config/config.php
@SantoshSrinivas79
SantoshSrinivas79 / gist:3608708
Created September 3, 2012 11:36
PyroCMS folder permissions
sudo chmod -R 777 system/cms/cache
sudo chmod -R 777 system/cms/config
sudo chmod -R 777 addons
sudo chmod -R 777 assets/cache
sudo chmod -R 777 uploads
sudo chmod -R 666 system/cms/config/config.php
@SantoshSrinivas79
SantoshSrinivas79 / blog_featured_image.php
Created September 15, 2012 09:38
Featured image description for PyroCMS Blog Stream
@SantoshSrinivas79
SantoshSrinivas79 / Heatmap.R
Created September 28, 2012 05:21 — forked from dsparks/Heatmap.R
ggplot2 heatmap with "spectral" palette
# Simple ggplot2 heatmap
# with colorBrewer "spectral" palette
doInstall <- FALSE # Change to FALSE if you don't want packages installed.
toInstall <- c("ggplot2", "reshape2", "RColorBrewer")
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
# Generate a random matrix
# This can be any type of numeric matrix,