17 private links
;;; It is the opposite of fill-paragraph
(defun unfill-paragraph ()
"Takes a multi-line paragraph and makes it into a single line of text."
(interactive)
(let ((fill-column (point-max)))
(fill-paragraph nil)))
And to bind it to a key:
;; Handy key definition
(define-key global-map "\M-Q" 'unfill-paragraph)
par Sylvestre Meininger (Le Monde diplomatique, mars 2008)
// Quarante ans après « La Nuit des morts-vivants », de George A. Romero, les films sur ces créatures qui nous menacent se multiplient, de « Je suis (...)
The father of the modern movie zombie and the inspiration for generations of horror filmmakers died of lung cancer Sunday, his family said.
Luther Blisset, net.gener@ationmanifesto delle nuove libertà1 edizione, febbraio 1996il libro beffa alla casa editrice...
Middleware is a function that receives the request and response objects of an HTTP request/response cycle. It may modify (transform) these objects before passing them to the next middleware function in the chain. It may decide to write to the response; it may also end the response without continuing the chain.
In other frameworks “middleware” is called “filters”, but the concept is the same: a request, response, and some transformation functions.
The Technoethical X200 is a refurbished 12.1″ fairly modular/customizable Lenovo ThinkPad X200 laptop preinstalled with Libreboot, the fully free BIOS replacement, and with a fully free GNU/Linux operating system (Trisquel). Enjoy the freedom of having best control of your computing, privacy and security by using the Technoethical X200.
Libreboot is the fully free BIOS/UEFI replacement endorsed by the FSF. It is based on Coreboot, having the nonfree parts removed and better build system. While most people tend to overlook the importance of having fully free BIOS/UEFI and bootloaders, emphasizing only the need to have a free main operating system, these lower layers of the computer can contain backdoors and security vulnerabilities which have the potential to violate user's freedoms and privacy.
However, the control over your computer with a fully free BIOS is incomplete without a fully free GNU operating system, endorsed by the FSF and other free software organizations like Ceata. A fully free system doesn't preinstall, host or recommend nonfree software. Thus users can feel protected from the dangers of proprietary world and also feel part of the community which contributes to the advancement of the free digital society. The society which Richard Stallman has envisioned and has been fighting for for more than 30 years.
We at Technoethical are doing our best to offer you the best free software compatible X200 which reaches its maximum potential. Thus, we replace the nonfree firmware Wi-Fi card with a free software compatible 3-antenna Atheros AR9380-based one, and we upgrade the memory to the maximum capacity of 8GB.
A similar freedom-respecting laptop based on the ThinkPad X200 is also available at our friends Vikings and Libiquity.
Technoethical donates part of its income to different free software projecs. We list the donations on the page Technoethical donations.
Whether you’re maintaining a personal todo list, planning your holidays with
some friends, or working in a team on your next revolutionary idea, Kanban
boards are an unbeatable tool to keep your things organized. They give you a
visual overview of the current state of your project, and make you productive by
allowing you to focus on the few items that matter the most.
Wekan has real-time user interface. Not all features are implemented.
Alternatively, if you are creating the theme yourself and/or can modify it, you can create an action yourself using WordPress' do_action
function. This is also how they create their other hooks. So basically in your theme, you would go where you want to, right after the <body>
tag, and do something like:
do_action('after_body');
You can also pass arguments to the action callback, see the linked documentation for information.
Then afterwards, you would simply use the add_action
function to hook onto it.
add_action('after_body', 'my_callback');
Hope that helps. Sorry if I misunderstood.
A child theme is a theme that inherits the functionality and styling of another theme, called the parent theme. Child themes are the recommended way of modifying an existing theme.
Why use a Child Theme?
There are a few reasons why you would want to use a child theme:
If you modify a theme directly and it is updated, then your modifications may be lost. By using a child theme you will ensure that your modifications are preserved.
Using a child theme can speed up development time.
*Using a child theme is a great way to learn about WordPress theme development.
A standardized, organized, object-oriented foundation
for building high-quality WordPress Plugins.
JavaScript function hoisting by example
Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.
To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js
Notes on hoisting
(I may be using incorrect terms below, please forgive me)
When JS is parsed, a first pass is done over each scope, and function definitions are immediately discovered. An example of a function definition is function foo() {}. When a function is declared like this, with a name, that name becomes available to the entire scope when the code in that scope is executed.
A crude timeline of how JS gets executed:
Parse the scope and detect all function definitions
Execute the code top-to-bottom with all functions found in step 1 available as variables
This behavior is called 'hoisting' because it is almost like the function definitions have been 'hoisted' up to the top of the function.
Assignments are not evaluated until the code is executed. An example of an assignment is var foo = function() {} or var foo = function foo() {}. A function must not be associated with an assignment in order for it to be hoisted (see example L)
Wrapping a function in parenthesis (()) is a quick way to convert a function definition into a function expression, which means it does not get hoisted (similar to assigning the function to a variable). I personally do not use this pattern regularly as I find it overly confusing to newbies etc, but I have included it because it is widely used in e.g. jQuery plugins.
I use hoisting as a code organization tool, for example here I rely on hoisting to make parseStream() available on line 20, even though it is defined on line 41, which I think makes that file more readable as I can put the 'meat' of the function at the top.
Callbacks are just the name of a convention for using JavaScript functions. There isn't a special thing called a 'callback' in the JavaScript language, it's just a convention. Instead of immediately returning some result like most functions, functions that use callbacks take some time to produce a result. The word 'asynchronous', aka 'async' just means 'takes some time' or 'happens in the future, not right now'. Usually callbacks are only used when doing I/O, e.g. downloading things, reading files, talking to databases, etc.
Summary
- Don't nest functions. Give them names and place them at the top level of your program
- Use function hoisting to your advantage to move functions 'below the fold'
- Handle every single error in every one of your callbacks. Use a linter like standard to help you with this.
- Create reusable functions and place them in a module to reduce the cognitive load required to understand your code. Splitting your code into small pieces like this also helps you handle errors, write tests, forces you to create a stable and documented public API for your code, and helps with refactoring.
The most important aspect of avoiding callback hell is moving functions out of the way so that the programs flow can be more easily understood without newcomers having to wade through all the detail of the functions to get to the meat of what the program is trying to do.
You can start by moving the functions to the bottom of the file, then graduate to moving them into another file that you load in using a relative require like require('./photo-helpers.js') and then finally move them into a standalone module like require('image-resize').
Here are some rules of thumb when creating a module:
- Start by moving repeatedly used code into a function
- When your function (or a group of functions related to the same theme) get big enough, move them into another file and expose them using module.exports. You can load this using a relative require
- If you have some code that can be used across multiple projects give it it's own readme, tests and package.json and publish it to github and npm. There are too many awesome benefits to this specific approach to list here!
- A good module is small and focuses on one problem
- Individual files in a module should not be longer than around 150 lines of JavaScript
- A module shouldn't have more than one level of nested folders full of JavaScript files. If it does, it is probably doing too many things
- Ask more experienced coders you know to show you examples of good modules until you have a good idea of what they look like. If it takes more than a few minutes to understand what is happening, it probably isn't a very good module.
More reading
Try reading my longer introduction to callbacks, or try out some of the nodeschool tutorials.
Also check out the browserify-handbook for examples of writing modular code.
What about promises/generators/ES6 etc?
Before looking at more advanced solutions, remember that callbacks are a fundamental part of JavaScript (since they are just functions) and you should learn how to read and write them before moving on to more advanced language features, since they all depend on an understanding of callbacks. If you can't yet write maintainable callback code, keep working at it!
If you really want your async code to read top-to-bottom, there are some fancy things you can try. Note that these may introduce performance and/or cross platform runtime compatibility issues, so make sure to do your research.
Promises are a way to write async code that still appears as though it is executing in a top-down way, and handles more types of errors due to encouraged use of try/catch style error handling.
Generators let you 'pause' individual functions without pausing the state of the whole program, which at the cost of slightly more complex to understand code lets your async code appear to execute in a top-down fashion. Check out watt for an example of this approach.
Async functions are a proposed ES7 feature that will further wrap generators and promises in a higher level syntax. Check them out if that sounds interesting to you.
Personally I use callbacks for 90% of the async code I write and when things get complicated I bring in something like run-parallel or run-series. I don't think callbacks vs promises vs whatever else really make a difference for me, the biggest impact comes from keeping code simple, not nested and split up into small modules.
Regardless of the method you choose, always handle every error and keep your code simple.
Remember, only you can prevent callback hell and forest fires
You can find the source for this on github.
We are a ground-breaking crossmedia distributor, building new revenue models for film, games, books and music. Our special event Bundles, focused on the best in indie culture, reach digital native customers all over the world.
We bring together creators looking for an effective way to distribute their work with a passionate community of customers eager to engage independent content. Our special event bundles are time-limited, themed and often curated by well-known names.
Right now we're working on a new product, Black Box, which will be launched later this year. Stay tuned for more..
WolfeOnDemand is the global LGBT movie-watching platform. The premium destination for all the best lesbian, gay, bi and transgender movies — available for streaming and download worldwide — WolfeOnDemand is powered by Vimeo and offers the highest quality viewing experience for movie lovers everywhere. Most titles come in deluxe editions complete with exclusive extra bonus features.
WolfeOnDemand is brought to you by Wolfe. Serving customers since 1985, Wolfe is the largest exclusive distributor of LGBT films. Explore WolfeOnDemand.com now and discover the world of LGBT cinema.
Browserify lets you require('modules') in the browser by bundling up all of your dependencies.
sudo cp -rp /home/my_home /media/backup/my_home
From cp manpage:
-p same as --preserve=mode,ownership,timestamps
--preserve[=ATTR_LIST]
preserve the specified attributes (default: mode,ownership,timestamps),
if possible additional attributes: context, links, xattr, all