Skip to content

Instantly share code, notes, and snippets.

@jpbecotte
jpbecotte / Vue-cli-3-Phoenix-1.3-HOWTO.md
Last active March 28, 2025 04:04
Vue-cli 3, Phoenix 1.3, a complete how-to

Introduction

I have been struggling to start a new project with Phoenix 1.3 and the new vue-cli 3 for Vue.js. There are tons of example already but none of them suited my needs, because:

  • I want to use the new Vue-cli to select the features that I want,
  • I do NOT want to setup Webpack (I know, what a shame!). The new Vue-cli includes the new vue-cli-service, which uses an instance of webpack-dev-server, so you don't have to import it manually in your project.
  • I do not want to use Brunch.

Create your Phoenix App

Assuming that you have Elixir and Phoenix 1.3 are both installed, let's build our new App.

@joepie91
joepie91 / .md
Last active June 25, 2023 08:51
Useful tools for working with NixOS
@mafintosh
mafintosh / npm-classic-config.sh
Last active June 21, 2018 17:40
Resets the npm defaults to how they used to be
npm config set loglevel http
npm config set progress false
npm config set package-lock false
npm config set save false
mkdir -p ~/.config/configstore/
printf '{"optOut": true,"lastUpdateCheck": 0}' > ~/.config/configstore/update-notifier-npm.json
@timwis
timwis / get-schema.sql
Last active May 4, 2017 10:38
Get postgres table schema including keys/constraints
SELECT
cols.column_name,
cols.data_type,
cols.character_maximum_length,
cols.column_default,
cols.is_nullable::boolean,
constr.constraint_type,
pg_catalog.col_description(cls.oid, cols.ordinal_position::int)::jsonb
FROM
pg_catalog.pg_class cls,
@allejo
allejo / division.html
Last active December 2, 2016 11:04
Do division in Liquid templates with support for decimals
{% capture whitespace %}
{% assign wholeNum = include.number | divided_by: include.divsor %}
{% assign remainder = wholeNum | times: include.divsor | minus: include.number | times: -1 %}
{% capture output %}{{ wholeNum }}.{% endcapture %}
{% for i in (1..include.decimals) %}
{% assign newNumer = remainder | times: 10 %}
{% assign workspace = newNumer | divided_by: include.divsor %}
{% assign remainder = workspace | times: include.divsor | minus: newNumer | times: -1 %}
@stefanmaric
stefanmaric / copy-to-clipboard-bookmarklet.md
Created September 7, 2016 20:54
Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard

Copy-to-clipboard Bookmarklet

Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard.

This is the base javascript:

(function (text) {
  var node = document.createElement('textarea')
  var selection = document.getSelection()
@onjin
onjin / docker-compose.yml
Created September 5, 2016 09:17
example docker compose for postgresql with db init script
postgres:
image: postgres:9.4
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
@Rich-Harris
Rich-Harris / service-workers.md
Last active May 3, 2025 12:49
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@JJediny
JJediny / gist:a466eed62cee30ad45e2
Created October 5, 2015 20:42
Jekyll Liquid Cheatsheet

There are two types of markup in Liquid: Output and Tag.

  • Output markup (which may resolve to text) is surrounded by
{{ matched pairs of curly brackets (ie, braces) }}
  • Tag markup (which cannot resolve to text) is surrounded by
@mcdougs
mcdougs / osmp-{Philly}-guidebook-philly.md
Last active January 27, 2016 02:57
Open Source Mentorship Program {Philadelphia} 2015: Organizers Guidebook

The Open Source Mentorship Program is a partnership between Code for America brigades and Girl Develop It chapters. The "Summer of Open Source" was piloted in Philadelphia over the summer of 2014. Met with great excitement from the success of the experiment, CfA and GDI cemented the partnership so that other brigades and chapters across the country might replicate and extend the impact of this collaboration.

In the summer of 2015, Philadelphia once again launched osmp. This guidebook is the result of their experience and includes both successes and opportunities for improvement. It is as comprehensive as possible, but the intention is for subsequent programs to fork and bu