I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
package com.tomtom.dcs.springconfig; | |
import java.util.Arrays; | |
import javax.ws.rs.core.Application; | |
import javax.ws.rs.ext.RuntimeDelegate; | |
import org.apache.cxf.bus.spring.SpringBus; | |
import org.apache.cxf.endpoint.Server; | |
import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; |
#!/usr/bin/env runhaskell | |
-- Filter that adds the metadata block as h1, h2, h3 (title, author, date). | |
-- | |
-- Usage:: | |
-- chmod +x ./chapter.hs | |
-- | |
-- # (where each chapter is in its own md file and I want to compile them | |
-- # into one document preserving the title/author/date for each chapter): | |
-- | |
-- for f in Chapter*.md; do \ |
Source: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
by Sander Marechal
I've written a simple Python class for creating daemons on unix/linux systems. It was pieced together for various other examples, mostly corrections to various Python Cookbook articles and a couple of examples posted to the Python mailing lists. It has support for a pidfile to keep track of the process. I hope it's useful to someone.
// ==UserScript== | |
// @name Replace pocket article view links with original links | |
// @updateURL https://gist.github.com/akatopo/db936ca93c02ff53b3c0/raw | |
// @downloadURL https://gist.github.com/akatopo/db936ca93c02ff53b3c0/raw | |
// @version 0.19 | |
// @description Replaces pocket article view links with original links without redirect | |
// and moves the article view link next to the delete button. Removes share and copy link buttons. | |
// @require https://cdnjs.cloudflare.com/ajax/libs/URI.js/1.18.1/URI.min.js#sha384=fwI1rPfq814p7OaC91S1eASL8OGwE9c9oY5F8ho98XH1f6XB9CQpvwvyQPl+Vl5B | |
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js#sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo= | |
// @match https://getpocket.com/saves* |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
import java.io.IOException; | |
import java.net.URLClassLoader; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.nio.file.Path; | |
/** | |
* Example demonstrating a ClassLoader leak. | |
* | |
* <p>To see it in action, copy this file to a temp directory somewhere, |
Nope. No program can be composed 100% of pure code because every program must do I/O work, which is inherently stateful. Most programs also need to carry around some amount of internal state, to one degree or another. The goal of functional programming, then, is to maximize the proportion of pure code to impure code in your program.
What does it mean for data and code to be pure? The short answer is that pure things are immutable, but this is not quite accurate: all pure things are immutable, but not all immutable things are pure. Pure things are not only unmodifiable but also definitional.
There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore
is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules
directory) as well as files that are generated (and regenerated) as artifacts of a build process.
All other files should be in your own global gitignore file:
- Create a file called
.gitignore
in your home directory and add any filepath patterns you want to ignore. - Tell git where your global gitignore file is.
Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute
.config/git/ignore
for.gitignore
in your home directory, if you prefer.
See comments section for more up-to-date versions of the script. The original script is from 2014 and will not work as is.
- Open news feed preferences on your Facebook menu (browser)
- Click people or pages
- Scroll down (or click see more) until your full list is loaded
- Run the script in your browser console
Facebook will block this feature for you while you use it, depending on how much entities you try to unfollow. It automatically unblocks in a couple of hours and you will be able to continue.