Skip to content

Instantly share code, notes, and snippets.

// Factories
app.factory('MyFactory', ['$http', function ($http) {
var baseURL = '/billing';
return {
fetch: function () {
var url = baseURL + '/fetch.json';
return $http.get(url);
},
updateCompanyInformation: function (company) {
var url = baseURL + '/update-company-info.json';
/**
* Parse Employee Data in CSV
* CAUTION : Do not attempt to understand this code!!!
**/
var csv = require('fast-csv')
, fs = require('fs')
, Q = require('q');
@elimence
elimence / crud_functionality.py
Created March 20, 2014 18:55
Import python package files from within another package
from helpers.validators import validate_movie_title
import sys
sys.path.append('/Users/c3po/Desktop/12_Python_Resubmission/entity')
from models import Movie
class CRUD:
def insert_movie(self):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=320, target-densitydpi=device-dpi">
<style type="text/css">
/* Mobile-specific Styles */
@media only screen and (max-width: 660px) {

About Scala

  • Functional programming is programming through the definition and composition of objects.
  • Object-oriented programming is programming through the definition and compositon of objects.
  • In Scala, functions are objects. Programs can be constructed through both the definition and composition of objects or functions. This gives Scala the ability to focus on nouns or verbs in a program, depending on what is the most prominent.

Functional programming meets object orientation

  • functional programming and object-oriented programming are two different ways of looking at a problem
@elimence
elimence / word_count.html
Created May 24, 2013 16:28
A too simplified and non-beautified way of counting words entered into a text area
<html>
<head>
<title>WORD COUNT TEST</title>
<style type="text/css">
#text {
height: 100px;
width: 200px;
}
</style>
</head>
@elimence
elimence / battery_monitor.py
Created May 23, 2013 18:15
This code runs as a daemon process and sounds an alarm when the battery isn't charging This is version 1.0 The next version would include alerts for battery levels and so on
#!/usr/bin/python
import sys
import time
import shlex
import subprocess
from daemon import runner
class Misc():
@elimence
elimence / free_port.py
Created May 23, 2013 12:04
This piece of code is used to terminate programs running on any port This is version 1.0 and so it doesn't do much besides this. More functionality will be added at a later date A lot of the code is unnecessary and is just there for fancy output Such code will be eliminated in version 2.0
#!/usr/bin/env python
import re
import sys
import shlex
import subprocess
from time import sleep