This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule NestedWeb.FormLive do | |
use NestedWeb, :live_view | |
require Logger | |
defmodule Form do | |
use Ecto.Schema | |
import Ecto.Changeset | |
embedded_schema do | |
field :name, :string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let Uploaders = {} | |
Uploaders.S3 = function (entries, onViewError) { | |
entries.forEach(entry => { | |
let xhr = new XMLHttpRequest() | |
onViewError(() => xhr.abort()) | |
xhr.onload = () => (xhr.status === 200 ? entry.done() : entry.error()) | |
xhr.onerror = () => entry.error() | |
xhr.upload.addEventListener("progress", event => { | |
if (event.lengthComputable) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install -y autoconf automake build-essential python-dev libtool libssl-dev pkg-config | |
cd /tmp | |
git clone https://github.com/facebook/watchman.git -b v4.9.0 --depth 1 | |
cd watchman/ | |
./autogen.sh | |
./configure --enable-lenient | |
make | |
sudo make install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
restart_sidekiq: &RESTART_SIDEKIQ | |
mode: "000755" | |
content: | | |
#!/bin/bash | |
initctl restart sidekiq || initctl start sidekiq | |
ln -sf /var/app/current/log/sidekiq.log /var/app/containerfiles/logs/sidekiq.log | |
mute_sidekiq: &MUTE_SIDEKIQ | |
mode: "000755" | |
content: | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Photoshop Script to Create iPhone Icons from iTunesArtwork | |
// | |
// WARNING!!! In the rare case that there are name collisions, this script will | |
// overwrite (delete perminently) files in the same folder in which the selected | |
// iTunesArtwork file is located. Therefore, to be safe, before running the | |
// script, it's best to make sure the selected iTuensArtwork file is the only | |
// file in its containing folder. | |
// | |
// Copyright (c) 2010 Matt Di Pasquale | |
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sidekiq interaction and startup script | |
commands: | |
create_post_dir: | |
command: "mkdir -p /opt/elasticbeanstalk/hooks/appdeploy/post" | |
ignoreErrors: true | |
files: | |
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq.sh": | |
mode: "000755" | |
owner: root | |
group: root |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set up global May Day object (md) to attach functions to | |
var md = md || {}; | |
(function($, md) { | |
// dollar sign ($) == jQuery | |
// Can add new functions to the jQuery prototype | |
$.fn.newFunction = function() { | |
return true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) receive the key that 10gen has setup | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 | |
2) sudo vi /etc/apt/sources.list and add this line at the end | |
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen | |
3) Update. This step is very important to load everything from sources.list from the previous step. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extension for string class | |
class String | |
# return character array of string with indices | |
def each_char_with_index | |
i = 0 | |
split(//).each do |c| | |
yield i, c | |
i += 1 | |
end | |
end |