Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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>

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
<!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) {
@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):
/**
* Parse Employee Data in CSV
* CAUTION : Do not attempt to understand this code!!!
**/
var csv = require('fast-csv')
, fs = require('fs')
, Q = require('q');
// 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';

Keybase proof

I hereby claim:

  • I am elimence on github.
  • I am elimence (https://keybase.io/elimence) on keybase.
  • I have a public key whose fingerprint is 844D A549 5C2D 3439 1055 380D 9BCB E2DD 971E 9B66

To claim this, I am signing this object:

@elimence
elimence / AnagramSort.java
Created February 13, 2015 10:58
AnagramSort.java
import java.util.Arrays;
import java.util.HashMap;
import java.util.ArrayList;
public class AnagramSort{
public static void main( String[] args ){
HashMap< Integer, ArrayList< String >> hm = new HashMap();