Skip to content

Instantly share code, notes, and snippets.

@lifeart
lifeart / component.js
Created February 6, 2020 14:42
Ember Cp Validations Octane
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import Object from "@ember/object";
import { reads } from "@ember/object/computed";
import { validator, buildValidations } from "ember-cp-validations";
import { getOwner } from "@ember/application";
const Validations = buildValidations({
billing_first_name: {
descriptionKey: "form.fields.billing_first_name",
@arkadiyk
arkadiyk / readme.md
Last active January 15, 2020 02:00
Compiled EmberJS in Docker

Compiled EmberJS App in Docker

The biggest problem deploying compiled EmberJS apps as a container is the configuration defined during compile time and becomes part of the image. Which is not ideal as you probably want to move the image between QA/UAT and prod without any modification.

The solution I will describe here looks like a hack but it's been working for me.

  1. I put config <meta> tag into index.html:
@hergaiety
hergaiety / async-await-runloop-example.js
Created January 24, 2018 14:37
Leveraging async/await for the Ember runloop, simply.
const emberRunloop = (queue = 'sync') => new Promise(resolve => {
scheduleOnce(queue, () => {
resolve();
});
});
export default Component.extend({
async _myFunction() {
await emberRunloop('afterRender');
// Do your stuff after above specified ember runloop
@ahmadshah
ahmadshah / randomizer.ex
Created September 1, 2016 10:28
Random string in elixir
defmodule Randomizer do
@moduledoc """
Random string generator module.
"""
@doc """
Generate random string based on the given legth. It is also possible to generate certain type of randomise string using the options below:
* :all - generate alphanumeric random string
* :alpha - generate nom-numeric random string
@anoochit
anoochit / docker-compose.yml
Created February 24, 2016 15:16
wordpress compose file v2 with docker volume
version: '2'
services:
db:
image: mysql
environment:
- MYSQL_ROOT_PASSWORD=mypass
volumes:
- db-data:/var/log/mysql
wp:
@hsleonis
hsleonis / better-font-smoothing.css
Last active June 13, 2024 18:26
Better font smoothing in cross browser
html {
/* Adjust font size */
font-size: 100%;
-webkit-text-size-adjust: 100%;
/* Font varient */
font-variant-ligatures: none;
-webkit-font-variant-ligatures: none;
/* Smoothing */
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
@manigandham
manigandham / rich-text-html-editors.md
Last active June 10, 2024 15:49
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

@kristianmandrup
kristianmandrup / Converting libraries to Ember CLI addons.md
Last active April 21, 2023 17:14
Guide to Developing Addons and Blueprints for Ember CLI

Converting libraries to Ember CLI addons

In this guide we will cover two main cases:

  • Ember specific library
  • vendor library

Ember library

The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.

@Chaser324
Chaser324 / GitHub-Forking.md
Last active June 16, 2024 07:13
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@davidpett
davidpett / filesize_helper.js
Created October 31, 2013 22:17
filesize handlebars helper
Ember.Handlebars.helper('filesize', function(value) {
if (typeof value === 'undefined') {
return null;
}
var i,
filesize,
units = ['B', 'KB', 'MB', 'GB', 'TB'];
for (i = 0; i < units.length; i++) {
if (value < 1024) {
filesize = Math.floor(value) + units[i];