Skip to content

Instantly share code, notes, and snippets.

View philippamarkovics's full-sized avatar

Philippa Markovics philippamarkovics

View GitHub Profile
;; my customizations on Jack Rusher's excellect emacs config
;; see https://github.com/jackrusher/dotemacs
;; This lives in ~/.emacs/lisp/
;; use find-file to open files
(global-set-key (kbd "s-o") 'find-file)
;; Project Management
(use-package counsel-projectile :ensure t)
(use-package projectile :ensure t)
@philippamarkovics
philippamarkovics / README.md
Created January 11, 2019 14:08
Building ProseMirror

Building it

npm install
npm run build
@philippamarkovics
philippamarkovics / gist:1477322
Created December 14, 2011 16:34
Timestamp mixin
Batman.mixins.timestamp =
initialize: ->
$timestamp = $(this)
timestampWatcher = setInterval (->
if $timestamp.attr("title") isnt "undefined" and $timestamp.attr("title") isnt ""
$timestamp.timeago()
clearInterval timestampWatcher
), 100
var ratio = height / width,
viewport = window.getSize();
var w, h;
if ((viewport.y / viewport.x) > ratio) {
h = viewport.y;
w = viewport.x / ratio;
}
else {
document.observe('dom:loaded', function() {
var products = $$('.product');
var updateTotal = function() {
var total = 0;
products.each(function(product) {
var amount = product.down('.amount');
if (!amount.value.blank() && ~~(amount.value) > 0) {
total += parseFloat(amount.value) * parseFloat(product.down('.entry-price').value);
}
});
<p>
<script type="text/javascript" charset="utf-8" id="fooo">
function foo() { console.log($('fooo').up()); }
foo();
</script>
</p>
Effect.Fade = function(element, options) {
element = $(element);
var oldOpacity = element.getOpacity() || '',
options = Object.extend({
after: Prototype.emptyFunction
}, options || { });
options.style = 'opacity:0;';
options.after = options.after.wrap(function(proceed, effect) {
effect.element.hide().setStyle({ opacity: oldOpacity });