Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
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: |
#!/bin/sh | |
# @author Rob Wu <gwnRob@gmail.com> (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 |
# 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 |
# 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 |
#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) |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
#!/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 |
#!/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" |
Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.
If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.
package main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"fmt" | |
) | |
func EncryptAESCFB(dst, src, key, iv []byte) error { | |
aesBlockEncrypter, err := aes.NewCipher([]byte(key)) |