Skip to content

Instantly share code, notes, and snippets.

@safhac
safhac / index.html
Last active June 22, 2016 14:24
drag if over top border
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body {
margin: 0 auto;
text-align: center;
}
@safhac
safhac / index.html
Last active June 27, 2016 13:53
listen to mouse move in window object instead of mouseover in list elements to overcome mouseout events from firing, calculate element index when knowing height
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body {
margin: 0 auto;
text-align: center;
}
@safhac
safhac / index.html
Created July 2, 2016 16:46
click to enlarge canvas clipped to circle
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
canvas {
float: left;
}
</style>
@safhac
safhac / calculator.js
Last active August 8, 2016 21:02
calculator closure
function calculator(operator) {
function func(a, b) {
return eval([a, operator, b].join(''));
};
return func;
}
var multiply = calculator('*');
@safhac
safhac / OnAnimationEnd.elm
Last active March 20, 2017 20:06
Elm OnAnimationEnd
module Main exposing (..)
import Html exposing (Html, text, div, Attribute)
import Html.Attributes exposing (class, style, attribute)
import Html.Events exposing (onClick, on)
import Json.Decode as Json exposing (succeed, oneOf)
main : Program Never Model Msg
main =
module Main exposing (..)
import Html exposing (Html, text, div, button, input)
import Html.Events exposing (onClick, onInput)
import Html.Attributes exposing (value)
main : Program Never Model Msg
main =
Html.program
module Main exposing (..)
import Html exposing (Html, div, text, button, Attribute)
import Html.Attributes exposing (class, id, style)
import Html.Events exposing (on, onClick)
import Json.Decode as Json exposing (succeed)
import Task exposing (perform)
main : Program Never Model Msg
@safhac
safhac / .block
Last active April 6, 2017 08:40 — forked from jmarca/.block
Doing the letter fall thing in Elm
license: GPL-3.0
@safhac
safhac / install-rabbitmq-centos-7.md
Created October 12, 2020 13:18 — forked from fernandoaleman/install-rabbitmq-centos-7.md
Install RabbitMQ on CentOS 7

Install RabbitMQ on CentOS 7

sudo yum -y install epel-release
sudo yum -y update

Install Erlang

Download repository

# uncommited file to HEAD
git diff <path>
# uncommited file to before last commit
git diff HEAD^ -- <path>
#last commit to before last commit
git diff HEAD^ HEAD -- <path>
#difference between HEAD and n-th grandparent