$ sudo -i
# vim /etc/systemd/system/overcommit_memory_1.service
# systemctl enable overcommit_memory_1
# systemctl start overcommit_memory_1
# systemctl status overcommit_memory_1
# cat /proc/sys/vm/overcommit_memory
def self.order(ids) | |
# The postgresql way | |
update_all(["position = STRPOS(?, ','||id||',')", ",#{ids.join(',')},"], { :id => ids }) | |
# the mysql way | |
# update_all(['position = FIND_IN_SET(id, ?)', ids.join(',')],{ :id => ids }) | |
end |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: consul | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: S 0 1 6 | |
# Short-Description: Consul service discovery framework | |
# Description: Healthchecks local services and registers | |
# them in a central consul database. |
--> Star this gist if you want to see it on the Reactive 2016 conference <--
Writing React.js is fun... But being able to draw React components, design responsive layouts and create entire app flows visually can be even more fun! (Especially for those non-coder members of your team who think ECMAScript 6 is a skin disease. They should see the light of React too.)
In this lightning talk, we'll give you a world premiere sneak peek at React Studio (www.reactstudio.com), a GUI tool built specifically for React. We'll explain how React's functional design makes it a great fit for visual tools. Also we will show how React Studio's plugin approach makes it a really powerful meta-programming system. Want to switch your app from Redux to Alt.js or vice versa? Just swap the state plugin and export again! That's just one of the joys of using a visual system for your Reactified visual design.
#!/bin/sh | |
CTARGET="$1" | |
if [ -z "$CTARGET" ]; then | |
program=$(basename $0) | |
echo "usage: $program TARGET_ARCH" | |
return 1 | |
fi | |
# get abuild configurables |
Brought to you by Headjack
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.
Let's start with some basics:
ffmpeg
calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file