Skip to content

Instantly share code, notes, and snippets.

@orefalo
orefalo / TemporalModel
Created November 16, 2010 15:26
DB independent and automatic update of create and update date fields - JPA
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import play.db.jpa.Model;
@orefalo
orefalo / gist:4211720
Created December 5, 2012 02:56
Change node.js process owner after bind on port 80
app.listen(80, 'localhost', null, function() {
// Listening
try {
console.log('Old User ID: ' + process.getuid() + ', Old Group ID: ' + process.getgid());
process.setgid('users');
process.setuid('orefalo');
console.log('New User ID: ' + process.getuid() + ', New Group ID: ' + process.getgid());
} catch (err) {
console.log('Cowardly refusing to keep the process alive as root.');
process.exit(1);
<body>
<br />
<style type='text/css'>
a{text-decoration:none !important}
table,tr,td,a,span,img {color:#b0b0b0;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;white-space:nowrap;border:none !important}
</style>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<meta name='format-detection' content='telephone=no' />
<meta name='format-detection' content='address=no' />
<meta name='format-detection' content='email=no' />
@orefalo
orefalo / cloudSettings
Created May 13, 2017 23:24
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-05-13T23:23:55.656Z","extensionVersion":"v2.7.0"}
### Keybase proof
I hereby claim:
* I am orefalo on github.
* I am kamikaze1001 (https://keybase.io/kamikaze1001) on keybase.
* I have a public key ASCH4uEbbyG0iFxemtA_JsojcGiZOob_VejQUmehwpJ6cwo
To claim this, I am signing this object: