Skip to content

Instantly share code, notes, and snippets.

View pvmsikrsna's full-sized avatar

pvmsikrsna

  • Hyderabad, India
View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
log_format postdata '$time_local $request $request_body';
location = /path {
access_log /var/log/nginx/postdata.log postdata;
proxy_pass http://localhost:8080; # <= set your port
}
@pvmsikrsna
pvmsikrsna / dirHtmlPageRenderToPng.js
Created March 17, 2016 17:15 — forked from crazy4groovy/dirHtmlPageRenderToPng.js
PhantomJS script to loop through local directory and render HTML pages as PNG
/* tested on PhantomJS 1.6 */
var page = require('webpage').create(), loadInProgress = false, fs = require('fs');
var htmlFiles = new Array();
// console.log(fs.workingDirectory);
// console.log(phantom.args[0]);
var curdir = phantom.args[0] || fs.workingDirectory;
var curdirList = fs.list(curdir);
@pvmsikrsna
pvmsikrsna / ArrayObjectDemo.coffee
Created March 13, 2016 15:03 — forked from frane/ArrayObjectDemo.coffee
Traversing arrays and objects in CoffeeScript
# Traversing arrays and objects in CoffeeScript
# The array and object we use for testing
arr = [1, 2, 3, 4, 5]
obj = {a: 1, b: 2, c: 3, d: 4, e: 5}
# 'in' has a different meaning in CoffeeScript than in JavaScript
# CS: element in array -> JS: array.indexOf(element) >= 0
console.log '5 in arr: ' + (5 in arr)
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
i:0,
actions:{
'increment':function(){
this.set('i',this.get('i')+1);
}
}
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
name:"Vamshi",
toUpper:"VAMSHI",
nameObserver: function(newValue){
this.set('toUpper',
this.get('name').toUpperCase())
}.observes('name')
@pvmsikrsna
pvmsikrsna / watchfile.sh
Created November 2, 2015 09:52 — forked from swarminglogic/watchfile.sh
watchfile - monitor file(s) and execute a command when files are changed
#!/bin/bash
version=1.0.1
versionDate="2014-02-14"
function showHelp() {
echo "watchfile - monitor file(s)/command and perform action when changed
Possible ways of usage
----------------------------------------
@pvmsikrsna
pvmsikrsna / ejabberd.yml
Created October 26, 2015 19:13
ejabberd config to make conversations client on android work perfectly
###
### ejabberd configuration file
###
###
### The parameters used in this configuration file are explained in more detail
### in the ejabberd Installation and Operation Guide.
### Please consult the Guide in case of doubts, it is included with
### your copy of ejabberd, and is also available online at
### http://www.process-one.net/en/ejabberd/docs/
sudo apt-get install erlang
sudo apt-get install ejabberd
sudo vim /etc/ejabberd/ejabberd.cfg
%% Admin user
{acl, admin, {user, "koss", "localhost"}}.
%% Hostname
{hosts, ["nocorp.ru"]}.
@pvmsikrsna
pvmsikrsna / .gitconfig
Created October 25, 2015 16:58
My Git Configuration
[core]
editor = vim
[user]
name = Mike Smullin
email = [email protected]
[color]
branch = auto
diff = auto
interactive = auto
status = auto