When a key combination is displayed, the modifiers are written in the order presented here. For example, Control + Option + Shift + Command + Q would be written as ⌃⌥⇧⌘Q.
| Sym | Key | Alt |
|---|---|---|
| ⌃ | Control | |
| ⌥ | Option |
| defmodule MigrateRedis do | |
| require Logger | |
| @from [host: "127.0.0.1", port: 6379] | |
| @to [host: "127.0.0.1", port: 6379] | |
| def migrate(from \\ @from, to \\ @to) do | |
| {:ok, from} = Redix.start_link(from) | |
| {:ok, to} = Redix.start_link(to) |
| defmodule Downloader do | |
| @moduledoc""" | |
| Download streams of bytes from URLs. | |
| Useful to transfer large files with low RAM usage. | |
| ## Example with `ExAWS.S3.upload/3` | |
| ```elixir | |
| url | |
| |> Downloader.stream_body!() |
| defmodule App.Factory do | |
| alias App.Repo | |
| def create(module, overrides \\ %{}) | |
| def create(module, overrides) when is_list(overrides), do: create(module, Map.new(overrides)) | |
| def create(module, overrides) do | |
| attributes = module.example() |> Map.merge(overrides) | |
| struct(module) |
| #!/bin/bash | |
| # Absolute path to this script, e.g. /home/user/bin/foo.sh | |
| SCRIPT=$(readlink -f "$0") | |
| # Absolute path this script is in, thus /home/user/bin | |
| SCRIPTPATH=$(dirname "$SCRIPT") | |
| echo $SCRIPTPATH | |
| export $(cat ${SCRIPTPATH}/.env | xargs) | |
| docker-compose -f ${SCRIPTPATH}/docker-compose.yml up |
| // ---- | |
| // Sass (v3.3.4) | |
| // Compass (v1.0.0.alpha.18) | |
| // ---- | |
| // Capitalize string | |
| // -------------------------------------------------------------------------------- | |
| // @param [string] $string | |
| // -------------------------------------------------------------------------------- | |
| // @return [string] |
| /* | |
| Go on your labels page (https://github.com/user/repo/labels) | |
| Edit the following label array | |
| or | |
| Use this snippet to export github labels (https://gist.github.com/MoOx/93c2853fee760f42d97f) | |
| and replace it | |
| Paste this script in your console | |
| Press Enter!! |
| //app.js Socket IO Test | |
| var app = require('express').createServer(), | |
| redis = require('socket.io/node_modules/redis'), | |
| io = require('socket.io').listen(app); | |
| var pub = redis.createClient(port, "url"); | |
| var sub = redis.createClient(port, "url"); | |
| var store = redis.createClient(port, "url"); | |
| pub.auth('pass', function(){console.log("adentro! pub")}); | |
| sub.auth('pass', function(){console.log("adentro! sub")}); |
| var injector = angular.injector(['module1', module2, 'ng']); | |
| var service = injector.get("serviceName"); |