Skip to content

Instantly share code, notes, and snippets.

View caritos's full-sized avatar
🏠
Working from home

Eladio Caritos caritos

🏠
Working from home
View GitHub Profile
@caritos
caritos / HelloWorldPart.java
Last active January 3, 2016 19:49
HelloWorldPart used in the code post for 2014-01-02-add-logging-via-dependency-injection.md
package com.caritos.e4.product.parts;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import org.eclipse.e4.ui.di.Focus;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.osgi.service.log.LogService;
@caritos
caritos / Application.java
Created January 19, 2014 20:40
Application.java. Demo file for Spring Boot
package demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ComponentScan
@EnableAutoConfiguration
http://openclassroom.stanford.edu/MainFolder/CoursePage.php?course=MachineLearning
import json
import urllib2
import simplejson
import logging
from django.shortcuts import render
from django.http import HttpResponse
def home(request):
result = simplejson.load(urllib2.urlopen('http://devtest3.spling.com/api/1/find_friends/facebook'))
@caritos
caritos / gist:1395455
Created November 26, 2011 10:56
AuthenticationForm
class AuthenticationForm(forms.Form):
"""
Base class for authenticating users. Extend this to get a form that accepts
username/password logins.
"""
username = forms.CharField(label=_("Username"), max_length=30)
password = forms.CharField(label=_("Password"), widget=forms.PasswordInput)
def __init__(self, request=None, *args, **kwargs):
"""
@font-face {
font-family: "NewFont";
src: url(NewFont.otf) format("opentype");
font-weight: normal;
font-style: normal;
}
body {
font-family: NewFont, sans-serif;
}
@font-face {
font-family: Graublau Sans Web;
src: url(GraublauWeb.otf) format("opentype");
}
body {
font-family: Graublau Sans Web, Lucida Grande, sans-serif;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>{{ page.title }}</title>
<meta name="author" content="Eladio Caritos" />
<script src="/javascripts/prototype.js" type="text/javascript"></script>
<script src="/javascripts/scriptaculous.js" type="text/javascript"></script>
</head>