Skip to content

Instantly share code, notes, and snippets.

@markessien
markessien / chia_systemd_file.txt
Created November 2, 2020 08:06
Chia Systemd file
[Unit]
After=network.target
[Service]
Type=forking
User=ubuntu
ExecStart=/home/ubuntu/start_chia.sh
[Install]
WantedBy=default.target
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-28315089-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
@markessien
markessien / gist:960501
Created May 7, 2011 13:37
Quad Function
public double angleWith(Edge otherEdge) {
double angle1 = Math.atan2(getPoint1().getY() - getPoint2().getY(),
getPoint1().getX() - getPoint2().getX());
double angle2 = Math.atan2(otherEdge.getPoint1().getY() - otherEdge.getPoint2().getY(),
otherEdge.getPoint1().getX() - otherEdge.getPoint2().getX());
double resultRadians = angle1 - angle2;
double resultDegrees = resultRadians * (180 / Math.PI);
@markessien
markessien / Economy
Created February 15, 2011 09:03
There are two economic graduate students A and B
There are two economic graduate students A and B. The two of them walking on
a road when they discover a pile of dog shit. A says to B: Eat it and I’ll
give you 50 million. Hearing this, B thinks, “Wow, so easy to make 50 million,
even though it is a little stinky, at worst just take the money to go have my
stomach pumped,” and so he took the shit and ate it.
The two of them continue walking, but both feel a bit unhappy and uneven. A lost 50
million and got nothing in return. B, though it can be said that he earned 50 million,
doesn’t feel very good after eating the shit.
function filterEmail($email) {
$result = $email;
$replacements = array("hotmail.con" => "hotmail.com",
"hotmail" => "hotmail.com",
"gmail.con" => "gmail.com",
"aol.con" => "aol.com",
"yahoo.con" => "yahoo.com",
"yahoo.cpm" => "yahoo.com",
"g.mail.com" => "gmail.com",
"tiscsli.co.uk" => "tiscali.co.uk",