Skip to content

Instantly share code, notes, and snippets.

@joemaller
joemaller / re-thinking-angularjs.markdown
Last active Aug 29, 2015
Thoughts on the future of AngularJS
View re-thinking-angularjs.markdown

Re-thinking AngularJS

The [Angular 2.0 preview roadmap][ng-2] was recently posted to [HN][ng-hn] and after reading it, I'm starting to think adopting Angular might have been a mistake.

Having built a few small projects with [AngularJS][ng], I've found the framework a pleasure to work with. Once past the initial learning curve, features started flying together. Most of my trouble-shooting time was spent getting backend data delivered correctly, Angular just worked. Based on this positive experience, I've been moving towards adopting Angular as the standard frontend of my web toolkit.

Choosing Angular wasn't without doubts. Introducing this many new conventions, syntaxes and practices doesn't come without a cost. The problem with re-invention is longevity: Either these new ideas succeed and become the norm, or they're left for dead on the side of the road as technology marches on.

Parts of the 2.0 roadmap sound great. But it also sounds as if this future Angular will be very different from the Angular w

View gulp-ify.js
gulp.task('gulpify', function() {
gulp.src("./src/js/**")
.pipe($.plumber())
//using vinyl-transform lets us use any transforms available to browserify
.pipe(transform(reactify))
.on('error', $.util.log)
.pipe($.ext.replace('.js'))
// converting .jsx/coffee/etc. into a temp folder prior to 'bundling' reduces additional boilerplate later-on
.pipe(gulp.dest('./temp'))
.pipe($.filter('init.js'))
@joemaller
joemaller / one-line-sourcemap.css
Created Jul 12, 2014
This is the CSS file that's failing to be picked up by convert-source-map. Mentioned here: https://github.com/thlorenz/convert-source-map/pull/6#issuecomment-48799449
View one-line-sourcemap.css
body p{color:red;}body h1{color:orange;}body h1 p{color:green;}/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJhcHAvc2Nzcy90ZXN0LnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsS0FBSyxFQUVHLE1BQU8sS0FDZixLQUFLLEdBRUcsTUFBTyxRQUFmLEtBQUssR0FBRyxFQUVJLE1BQU8iLCJzb3VyY2VzQ29udGVudCI6WyJib2R5IHtcbiAgICBwIHtcbiAgICAgICAgY29sb3I6IHJlZDtcbiAgICB9XG4gICAgaDEge1xuICAgICAgICBjb2xvcjogb3JhbmdlO1xuICAgICAgICBwIHtcbiAgICAgICAgICAgIGNvbG9yOiBncmVlbjtcbiAgICAgICAgfVxuICAgIH1cbn0iXX0=*/
@joemaller
joemaller / gist:c05ca826971f9b563ce8
Created Jan 16, 2015
View a uniq list of connections from /var/log/vsftpd.log
View gist:c05ca826971f9b563ce8
sudo grep CONNECT /var/log/vsftpd.log | cut -d ']' -f2 | uniq
@joemaller
joemaller / README.md
Last active Aug 29, 2015
AutoFill bookmarklet - For quickly populating web forms for testing.
View README.md

To install, just copy this url into a bookmark:

javascript:(function(){var s=document.createElement('script');s.type='text/javascript';s.async=true;s.src='https://rawgit.com/joemaller/6f1a1814d28d8aebd88a/raw/autofill.js';document.getElementsByTagName('head')[0].appendChild(s);})()

Lightly tested, seems to work most everywhere.

@joemaller
joemaller / README.md
Last active Aug 29, 2015
Kickstart wifi connection on old Mac
View README.md

My webcam is running on an old MacBook that seems to have a spotty connection to the internet. When this computer drops the wifi connection, it doesn't ever seem to reconnect. The networksetup command can be used to reconnect, so I'm calling this every 5 minutes from cron to force the connection.

The command was also added to /etc/sudoers so we can call the command with sudo without a password.

@joemaller
joemaller / fail2ban unbanip commands
Created Mar 5, 2015
Commands for unbanning IP address jailed by fail2ban
View fail2ban unbanip commands
sudo fail2ban-client set ssh unbanip 123.45.76.89
sudo fail2ban-client set vsftpd unbanip 123.45.76.89
# sudo fail2ban-client set [jail_name] unbanip [ip_address]
@joemaller
joemaller / gulpfile.js
Last active Aug 29, 2015
A proof-of-concept gulpfile that reloads itself onchange. Not especially stable and leaves an orphan gulp process, but useful for quickly iterating a gulpfile.
View gulpfile.js
'use strict';
var gulp = require('gulp');
var spawn = require('child_process').spawn;
/**
* gulpfile-reload auto-reloads this gulpfile, called from 'watch'
* This leaves an orphaned gulp process running after `gulp watch` exits
*/
gulp.task('gulpfile-reload', function() {
@joemaller
joemaller / ca-counties.json
Last active Aug 29, 2015
TopoJSON files listing county name and population for a few US States. For a D3 experiment on CodePen.
View ca-counties.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Script.txt
Please Read the following out loud, pausing between words.
Register
One
Two
Three
Five
Eight
Thirteen