Since 2008 or 2009 I work on Apple hardware and OS: back then I grew tired of Linux desktop (which is going to be MASSIVE NEXT YEAR, at least since 2001), and switched to something that Just Works. Six years later, it less and less Just Works, started turning into spyware and nagware, and doesn't need much less maintenance than Linux desktop — at least for my work, which is system administration and software development, probably it is better for the mythical End User person. Work needed to get software I need running is not less obscure than work I'd need to do on Linux or othe Unix-like system. I am finding myself turning away from GUI programs that I used to appreciate, and most of the time I use OSX to just run a terminal, Firefox, and Emacs. GUI that used to be nice and unintrusive, got annoying. Either I came full circle in the last 15 years of my computer usage, or the OSX experience degraded in last 5 years. Again, this is from a sysadmin/developer ki
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| name="$1" | |
| shift | |
| PATHS="org.mpris.MediaPlayer2.$name /org/mpris/MediaPlayer2" | |
| DBUS_SEND="dbus-send --type=method_call --dest=$PATHS" | |
| RC="$DBUS_SEND org.mpris.MediaPlayer2.Player" | |
| if [ "$@" = "prev" ]; then | |
| $RC.Previous | |
| elif [ "$@" = "stop" ]; then | |
| $RC.Pause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'action_dispatch/routing' | |
| require 'json' | |
| routes = ::ActionDispatch::Routing::RouteSet.new | |
| routes.draw do | |
| namespace :admin do | |
| resources :users | |
| end | |
| resources :ducks do | |
| member do |
I'm currently the lead instructor at Code Platoon and an instructor/developer at the Turing School of Software and Design.
I've been advocating the Fish shell and when the choice is up to me, I choose that for my students. Enough people ask about the decision, particularly in relation to the preinstalled Bash shell, that I figured it's worth laying out my reasoning.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns dynamic.test | |
| (:require [clojure.test :refer :all])) | |
| ;; This example shows how tests can be generated dynamically, by | |
| ;; creating new vars with the correct metadata. | |
| (defn add-test | |
| "Add a test to the given namespace. The body of the test is given as | |
| the thunk test-fn. Useful for adding dynamically generated deftests." | |
| [name ns test-fn & [metadata]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * GINISS and THEILT Copyright 2018- Paul Brewer, Economic and Financial Technology Consulting LLC <[email protected]> | |
| * This file may be used or copied under the terms of the MIT License as explained below or at https://opensource.org/licenses/MIT | |
| * The MIT License | |
| * 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, distribute, sublicense, and/or sell copies of the Software, and | |
| * to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
| * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the | |
| * Software. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defn heredoc [] | |
| (let [delim (.readLine *in*)] | |
| (->> (repeatedly #(.readLine *in*)) | |
| (take-while #(not= delim %)) | |
| (interpose \newline) | |
| (apply str)))) | |
| ; The following lines are read (by the reader) as: | |
| ; "Look )(\"\\T\na here doc!\n" | |
| #=(heredoc)""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function()%7Bconsole.log(%0A%20%20Array.from(document.querySelectorAll('h1%2C%20h2%2C%20h3%2C%20h4%2C%20h5%2C%20h6')).reduce((str%2C%20heading%2C%20index%2C%20arr)%20%3D%3E%20%7B%0A%20%20%20%20const%20level%20%3D%20Number(heading.tagName.slice(1))%3B%0A%0A%20%20%20%20if%20(level%20%3D%3D%3D%201%20%26%26%20heading.textContent%20%3D%3D%3D%20'No%20Preview')%20%7B%0A%20%20%20%20%20%20return%20str%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20const%20style%20%3D%20getComputedStyle(heading)%3B%0A%20%20%20%20const%20previousLevel%20%3D%20index%20%3D%3D%3D%200%20%3F%20level%20%3A%20Number(arr%5Bindex%20-%201%5D.tagName.slice(1))%3B%0A%20%20%20%20const%20indentation%20%3D%20(level%20-%20previousLevel%20%3E%201%20%3F%20'*'%20%3A%20'-').repeat(level)%3B%0A%20%20%20%20const%20isAriaHidden%20%3D%20heading.getAttribute('aria-hidden')%20%3D%3D%3D%20'true'%3B%0A%20%20%20%20const%20isDisplayNone%20%3D%20style.display%20%3D%3D%3D%20'none'%3B%0A%20%20%20%20const%20isVisibilityHidden%20%3D%20style.visibility%20%3D%3D%3D%20'h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # get some ideas from https://github.com/zkat/genfun, https://www.npmjs.com/package/protoduck, and https://www.npmjs.com/package/@zkat/protocols | |
| module X | |
| module Generic | |
| Any = BasicObject | |
| DefaultArgs = [Any] | |
| def define_generic_method(name, *args, &blk) | |
| if args.empty? | |
| raise TypeError, "Useless use of a generic method, you should have some arguments, otherwise a normal method is preferrable" | |
| end |
OlderNewer