Skip to content

Instantly share code, notes, and snippets.

View silentworks's full-sized avatar

Andrew Smith silentworks

View GitHub Profile
(function($, window, undefined) {
var InfiniteScroll = function() {
this.initialize = function() {
this.setupEvents();
};
this.setupEvents = function() {
$(window).on(
'scroll',
this.handleScroll.bind(this)
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@silentworks
silentworks / README.md
Created May 1, 2018 13:39 — forked from afgane/README.md
An Ansible playbook for setting up a host to run Ansible itself.

Create an inventory file such called hosts with the following content (adjusting the IP address)

[ansible-hosts]
129.114.18.39 ansible_ssh_private_key_file=key_pair.pem ansible_ssh_user=ubuntu  # Ubuntu target

From an Ansible-enabled machine, download playbook.yml and run it with

@silentworks
silentworks / main.yml
Created April 28, 2018 10:07 — forked from fulv/main.yml
Ansible - Creating users and copying ssh keypair files to the remote server
Put this in your `local-configure.yml` file, add as many users as you need:
users:
- name: fulvio
sudoer: yes
auth_key: ssh-rsa blahblahblahsomekey this is actually the public key in cleartext
- name: plone_buildout
group: plone_group
sudoer: no
auth_key: ssh-rsa blahblahblah ansible-generated on default
Fri Apr 27 09:29:04 UTC 2018
@silentworks
silentworks / how-to-set-up-stress-free-ssl-on-os-x.md
Created February 28, 2018 13:37 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@silentworks
silentworks / remove-docker-containers.md
Created September 8, 2017 09:54 — forked from ngpestelos/remove-docker-containers.md
How to remove unused Docker containers and images
  1. Delete all containers

     $ docker ps -q -a | xargs docker rm
    

-q prints only the container IDs -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID

  1. Delete all untagged images
@silentworks
silentworks / App.html
Created September 5, 2017 15:26 — forked from anonymous/App.html
Svelte component
<label>
<input type='checkbox' bind:checked='visible'> visible
</label>
{{#if visible}}
<div transition:scale></div>
{{/if}}
<style>
div {
@silentworks
silentworks / App.html
Created September 5, 2017 15:25 — forked from anonymous/App.html
Svelte component
<Modal bind:showModal title="Hello World" content="How are you man, this is something that isn't coming along." />
<a href="#" on:click="set({showModal: true})">Modal Open</a>
<script>
import Modal from './Modal.html';
export default {
data: function () {
return {
@silentworks
silentworks / App.html
Created September 5, 2017 15:24 — forked from anonymous/App.html
Svelte component
<label>
<input type='checkbox' bind:checked='visible'> visible
</label>
{{#if visible}}
<div in:fade="{ duration: 300 }" out:fly="{ duration: 300, delay: 300, y: -80 }">
<div class="inner" transition:scale="{ duration: 600 }"></div>
</div>
{{/if}}