sudo apt-get install python3-pip
sudo pip3 install virtualenv
#!/bin/sh | |
$(convert ~/Pictures/Wallpapers/$(ls ~/Pictures/Wallpapers|shuf -n 1) <(curl wttr.in/Tashkent_tgp0.png) -geometry +50+50 -composite /tmp/wallpaper.jpg && feh --bg-fill /tmp/wallpaper.jpg)& |
object Entities { | |
case class Review(txt: String, userId: Long, id: Long) | |
case class User(name: String, id: Long) | |
case class ReviewEvent(event: String, reviewId: Long) | |
case class FullReview(r: Review, user: User, evts: Seq[ReviewEvent]) | |
} |
Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'
Example: To get json record having _id equal 611
cat my.json | jq -c '.[] | select( ._id | contains(611))'
Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)
If you’re trying to delete a very large number of files at one time (I deleted a directory with 485,000+ today), you will probably run into this error:
/bin/rm: Argument list too long.
The problem is that when you type something like “rm -rf ”, the “” is replaced with a list of every matching file, like “rm -rf file1 file2 file3 file4” and so on. There is a reletively small buffer of memory allocated to storing this list of arguments and if it is filled up, the shell will not execute the program. To get around this problem, a lot of people will use the find command to find every file and pass them one-by-one to the “rm” command like this:
find . -type f -exec rm -v {} \;
My problem is that I needed to delete 500,000 files and it was taking way too long.
/*** | |
* This script will anchor a GameObject to a relative screen position. | |
* This script is intended to be used with ViewportHandler.cs by Marcel Căşvan, available here: http://gamedev.stackexchange.com/a/89973/50623 | |
* It is also copied in this gist below. | |
* | |
* Note: For performance reasons it's currently assumed that the game resolution will not change after the game starts. | |
* You could not make this assumption by periodically calling UpdateAnchor() in the Update() function or a coroutine, but is left as an exercise to the reader. | |
*/ | |
/* The MIT License (MIT) |
Now located at https://github.com/JeffPaine/beautiful_idiomatic_python.
Github gists don't support Pull Requests or any notifications, which made it impossible for me to maintain this (surprisingly popular) gist with fixes, respond to comments and so on. In the interest of maintaining the quality of this resource for others, I've moved it to a proper repo. Cheers!
<databaseChangeLog | |
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" | |
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog ../../xsd/dbchangelog-2.0.xsd | |
http://www.liquibase.org/xml/ns/dbchangelog-ext ../../xsd/dbchangelog-ext.xsd" | |
logicalFilePath="drop_trigger_changelog.xml"> | |
<changeSet id="1" author="stefanborghys" runOnChange="true"> | |
<preConditions onFail="MARK_RAN"> |
def runserver(port=5000, profile_log=None): | |
"""Runs a development server.""" | |
from gevent.wsgi import WSGIServer | |
from werkzeug.serving import run_with_reloader | |
from werkzeug.debug import DebuggedApplication | |
from werkzeug.contrib.profiler import ProfilerMiddleware | |
port = int(port) | |
if profile_log: |