Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| #!/bin/bash | |
| # chkconfig: - 80 12 | |
| # description: Controller for redis-server | |
| # processname: redis | |
| # useage: redis {start|stop|restart} | |
| # notice, you need to edit these 4 variables bellow to suit your condition | |
| BIN="/usr/local/redis/bin/redis-server" |
| #!/bin/sh | |
| rpm -Uih https://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | |
| curl -L https://get.rvm.io | bash -s stable | |
| rvm install 2.0.0 | |
| rvm use 2.0.0@global --default | |
| # for chinese user, if you have a wonderful speed ignore this part | |
| # to have a faster download speed | |
| # switch gem source to ruby.taobao.org |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| #include <roxlu/core/Log.h> | |
| #include <roxlu/core/Utils.h> | |
| #include <video/X264Encoder.h> | |
| X264Encoder::X264Encoder() | |
| :in_width(0) | |
| ,in_height(0) | |
| ,in_pixel_format(AV_PIX_FMT_NONE) | |
| ,out_width(0) | |
| ,out_height(0) |
| # Output to a jpeg file | |
| set terminal jpeg size 1280,720 | |
| # Set the aspect ratio of the graph | |
| set size 1, 1 | |
| # The file to write to | |
| set output "timeseries.jpg" | |
| # The graph title |
| # UPD from 2018: | |
| # This gist was written for pre-1.0 version of Elixir and won't work on post-1.0 versions. | |
| # You probably consider using something else! | |
| defmodule SecureRandom do | |
| @moduledoc """ | |
| Ruby-like SecureRandom module. | |
| ## Examples |
| #!/bin/sh | |
| # @author Rob Wu <[email protected]> (https://robwu.nl) | |
| version=$1 | |
| if [[ "${version}" != *"."* ]] ; then | |
| echo "Repeat the command with an exact version:" | |
| suffix="[0-9.]*" | |
| # Version not specified in $1 | |
| [ -z $version ] && suffix="[0-9][0-9.]+" | |
| curl -s http://www.oldapps.com/google_chrome.php | grep -oP "google_chrome.php\?old_chrome=[0-9]+\">[A-Za-z ]+\K${version}${suffix}( [A-Za-z()]+)?" -m 10 | |
| elif [ -e "${version}_chrome_installer.exe" ] ; then |
| defmodule Constants do | |
| @moduledoc """ | |
| An alternative to use @constant_name value approach to defined reusable | |
| constants in elixir. | |
| This module offers an approach to define these in a | |
| module that can be shared with other modules. They are implemented with | |
| macros so they can be used in guards and matches | |
| ## Examples: |
| [Unit] | |
| Description=Shadowsocks Server | |
| After=network.target | |
| [Service] | |
| Type=forking | |
| PIDFile=/run/shadowsocks/server.pid | |
| PermissionsStartOnly=true | |
| ExecStartPre=/bin/mkdir -p /run/shadowsocks | |
| ExecStartPre=/bin/chown nobody:nogroup /run/shadowsocks |
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the \ commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)