Skip to content

Instantly share code, notes, and snippets.

View pyprism's full-sized avatar
🪐
exploring universe

Ashutosh Das pyprism

🪐
exploring universe
View GitHub Profile
var baseUrl= 'http://127.0.0.1:8000/api/v1/todo/' ;
angular.module('todo', ['ngRoute'])
.config(function($routeProvider){
$routeProvider
.when('/', {
templateUrl : 'partials/home.html',
controller : 'home'
})
.when('/todo', {
var baseUrl= 'http://127.0.0.1:8000/api/v1/todo/' ;
angular.module('todo', ['ngRoute'])
.config(function($routeProvider){
$routeProvider
.when('/', {
templateUrl : 'partials/home.html',
controller : 'home'
})
.when('/todo', {
@pyprism
pyprism / disk.py
Last active August 29, 2015 14:05
voila !
import subprocess
import os
import getpass
def hiren():
raw_mounted_dir = subprocess.check_output(["volname", "/dev/sr0"])
mounted_dir = raw_mounted_dir.strip().decode('ascii').replace("_", " ")
print(os.listdir("/media/" + getpass.getuser() + "/" + mounted_dir))
@pyprism
pyprism / disk.py
Last active August 29, 2015 14:05
import subprocess
import os
import getpass
def hiren():
raw_mounted_dir = subprocess.check_output(["volname", "/dev/sr0"])
mounted_dir = raw_mounted_dir.strip().decode('utf-8').replace("_", " ")
list_string = list(mounted_dir)
counter = 0
from Crypto.Cipher import AES
import hashlib
#source https://www.youtube.com/watch?v=lsflaKpeB7Q
def pad(s):
return s + ((16-len(s) % 16) * "{")
def digest(key):
@pyprism
pyprism / gist:7773018
Created December 3, 2013 17:06
Convert XML to JSON
// Changes XML to JSON
function xmlToJson(xml) {
// Create the return object
var obj = {};
if (xml.nodeType == 1) { // element
// do attributes
if (xml.attributes.length > 0) {
obj["@attributes"] = {};
@pyprism
pyprism / x.js
Created November 14, 2013 08:48
if (Meteor.isClient) {
Template.hello.greeting = function () {
return "Welcome to y.";
};
Template.hello.events({
'click input' : function () {
// template data, if any, is available in 'this'
Meteor.call("hiren",function (err, data) {
console.log(data);
<head>
<title>x</title>
</head>
<body>
{{> hello}}
</body>
<template name="hello">
<h1>Hello World!</h1>
{
"name": "name example",
"description": "desc",
"homepage":"as",
"author" : "xyz",
"version" : "0.1",
"packages": {}
}
Package.describe({
summary: "summary etc"
});
Package.on_use(function (api){
api.use(["http"],["server"]);
api.add_files("nisha.js","server");
});