Skip to content

Instantly share code, notes, and snippets.

View uicoded's full-sized avatar

Jan uicoded

View GitHub Profile
@uicoded
uicoded / simpleFileDragAndDrop.js
Created May 29, 2019 21:29 — forked from chfritz/simpleFileDragAndDrop.js
HTML5: simple file drag&drop (without upload).
/*
(MIT License)
Copyright (c) 2012 Christian Fritz
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
@uicoded
uicoded / macos-recovery-server.md
Last active October 16, 2018 15:52
Fixing "The recovery server could not be contacted" in MacOS High Sierra

Upgrading to High Sierra on older machines

ERROR: The recovery server could not be contacted

It appears that this has to do with the time on the machine not being synchronized, so when the MacBook tries to reach out to the recovery server the certificates do not validate and we get this useless error message.

Solution 1: Update Time

  1. Run in Terminal (possibly with sudo)

pdfmake

Use in node.js

The module on npm exposes the pdfmake Printer, which the docs themselves do not cover. Using it is pretty simple though.

var path = require('path');
var Printer = require('pdfmake');
@uicoded
uicoded / angular-jqlite.adoc
Last active March 15, 2018 22:39 — forked from esfand/angular-jqlite.adoc
Angular jqLite

Angular jqLite

jQuery and Angular

Angular doesn’t depend on jQuery. In fact, the Angular source contains an embedded lightweight alternative: jqLite. Still, when Angular detects the presence of a jQuery version in your page, it uses that full jQuery implementation in lieu of jqLite. One direct way in which this manifests itself is with Angular’s element abstraction.

@uicoded
uicoded / README.md
Last active December 3, 2017 04:47 — forked from zanarmstrong/d3formatting.css
d3 time formatting example

Created by: Zan Armstrong This little tool helps you try out d3.time.format specifiers. Documentation for time format specifiers is here.

@uicoded
uicoded / .block
Last active November 9, 2017 22:02 — forked from lebek/amzn.csv
Responsive Visualizations: Basic Graph
license: mit
@uicoded
uicoded / README.md
Created March 5, 2017 06:25 — forked from emeeks/README.md
An online tool for interactive teaching of network visualization and representation principles.

The range sliders at the top change the values for the force-directed algorithm and the buttons load new graphs and apply various techniques. This will hopefully serve as a tool for teaching network analysis and visualization principles during my Gephi courses and general Networks in the Humanities presentations.

Notice this includes a pretty straightforward way to load CSV node and edge lists as exported from Gephi.

It also includes a pathfinding algorithm built for the standard data structure of force-directed networks in D3. This requires the addition of .id attributes for the nodes, however.

Now with Clustering Coefficients!

Also, it loads images for nodes but the images are not in the gist. The code also refers to different network types but the data files on Gist only refer to the transportation network.

@uicoded
uicoded / gist:2c44eb06c7d93586b2636fe2519ba2fc
Created February 17, 2017 03:36 — forked from thomseddon/gist:3511330
AngularJS byte format filter
app.filter('bytes', function() {
return function(bytes, precision) {
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-';
if (typeof precision === 'undefined') precision = 1;
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
number = Math.floor(Math.log(bytes) / Math.log(1024));
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
}
});
(function() {
angular
.module('myApp')
.directive('myUiGridResize', myUiGridResizeDirective);
/* @ngInject */
function myUiGridResizeDirective(gridUtil, uiGridConstants) {
return {
restrict: 'A',
require: 'uiGrid',
@uicoded
uicoded / git-loglive
Last active August 29, 2015 14:16 — forked from tlberglund/git-loglive
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $*
sleep 1
done