Skip to content

Instantly share code, notes, and snippets.

Jan Dudek jdudek

View GitHub Profile
@jdudek
jdudek / .gitattributes
Created Jul 3, 2018
Git: visual diff of images
View .gitattributes
*.png diff=diff-image
*.jpg diff=diff-image
*.jpeg diff=diff-image
*.gif diff=diff-image
@jdudek
jdudek / links.md
Last active Nov 24, 2015
Introduction to Elm @ React.js Meetup, Wrocław, 2015-11-24
View links.md
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Clipboard example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.5.5/clipboard.min.js"></script>
</head>
<body>
Install with:
<input type="text" value="elm package install evancz/elm-http 2.0.0" id="install-command" />
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Clipboard example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.5.5/clipboard.min.js"></script>
</head>
<body>
Install with:
<input type="text" value="elm package install evancz/elm-http 2.0.0" id="install-command" />
View gist:8c63abd5054d9a1db9e2
~/tmp/git-example (master) $ git log
fc8f07f 2014-06-25 15:25:14 +0200 | A (HEAD, master) [Jan Dudek]
530ef46 2014-06-25 15:08:41 +0200 | initial commit [Jan Dudek]
~/tmp/git-example (master) $ git log b
86c2a22 2014-06-25 15:25:49 +0200 | B (b) [Jan Dudek]
530ef46 2014-06-25 15:08:41 +0200 | initial commit [Jan Dudek]
~/tmp/git-example (master) $ git log c
773f7a1 2014-06-25 15:26:13 +0200 | C (c) [Jan Dudek]
View gist:5085515
var map = function (fn) { return function (arr) { return jQuery.map(arr, fn); } };
var each = function (fn) { return function (arr) { jQuery.each(arr, fn); } };
loadReplies: function() {
var _this = this, request;
request = jQuery.getJSON('/posts/' + this.get('id') + '/replies')
.then(map(Discourse.Post.create))
.then(each(function (post) { post.set('topic', _this.get('topic'); }))
View robot.js
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
View gist:3347991
def m1
/(a)/.match("abc")
p $1
m2()
p $1
end
def m2
/(b)/.match("abc")
p $1
View avl.c
#include <stdio.h>
#include <stdlib.h>
#define AVL_AS_LIST
typedef int AvlKey;
struct AvlNode {
AvlKey key;
char balance;
@jdudek
jdudek / gist:2136360
Created Mar 20, 2012
Jasmine: suite [] instead of nested describe
View gist:2136360
# suite ["shooter", "acceptance"], -> ...
# is equivalent to:
# describe "shooter", ->
# describe "acceptance", -> ...
window.suite = (names, block) ->
name = names.shift()
if names.length > 0
describe(name, -> suite(names, block))
else
You can’t perform that action at this time.