Skip to content

Instantly share code, notes, and snippets.

View cyk's full-sized avatar
💭
I may be slow to respond.

cyk

💭
I may be slow to respond.
View GitHub Profile
<?php
namespace Acme\YourBundle\Serializer;
use JMS\Serializer\Context;
use JMS\Serializer\JsonSerializationVisitor;
use JMS\Serializer\Metadata\ClassMetadata;
/*
* Copyright 2014 Paul Ferrett <paul@paulferrett.com>
@docteurklein
docteurklein / CompilerPass.php
Last active October 17, 2017 11:39
Service Repository Factory
<?php
public function process(ContainerBuilder $container)
{
$factory = $container->findDefinition('app.doctrine.repository.factory');
$repositories = [];
foreach ($container->findTaggedServiceIds('app.repository') as $id => $params) {
foreach ($params as $param) {
$repositories[$param['class']] = $id;
@jenweber
jenweber / be-loud-be-ready.md
Last active November 29, 2018 17:00
Be loud and be ready - my hopes for Ember.js in 2018

Be loud and be ready - my hopes for Ember.js in 2018

In 2018, I want to see Ember grow. But how could that be done in a strategic way? In this article, I'll take stock of our current resources and suggest how we could focus our efforts.

Sometimes when I am not sure how to achieve a goal, I imagine my future, successful self. I imagine that the goal has been achieved, using the same resources I have today, and I work backwards. What would I guess that those successful people of Future-Ember did?

  1. The people of Future-Ember worked to increase public awareness so that more developers knew about it and considered it for their projects. The Core Team led by example, writing and speaking, and the rest of the community was empowered to do the same.
  2. Future-Ember provided approachable, current, convincing materials for new visitors.

They were LOUD, and they were ready for the moment that they were heard.

@addyosmani
addyosmani / unit_testing.md
Last active July 27, 2020 05:17
Unit Testing Polymer Elements

Deprecated. See https://www.polymer-project.org/articles/unit-testing-elements.html for the latest version.

Unit Testing Polymer Elements

Note: this guide is a work-in-progress and will be added to the Polymer docs when it's ready. We have updated <seed-element> to include unit tests and this guide has been moved to Google docs. Expect a version on the Polymer site before the end of September.

After spending days working on your <super-awesome> Polymer element, you’re finally ready to share it with the rest of the world. You add the code for using it to your demo, iterate on it over time and come back to it one day when..uh oh. The demo broke because something has gone horribly wrong. Suddenly, <super-awesome> isn’t starting to look so great. Now you’re stuck trying to backtrack through your commit log to figure out how you broke the code. You’re not going to have a fun time.

If you’ve been working on the front-end for a while, even if you haven’t really played with Polymer elements before, this s

@slindberg
slindberg / ember-data.dependent-relations.js
Last active November 5, 2021 21:41
Dependent Relationships in Ember Data
/**
Ember Data: Dependent Relationships
This package extends Ember Data to support creating relationships
where a model's dirty state depends not only on its own attributes
but on the dirty state of models in dependent relationships as well.
```javascript
App.Thing = DS.Model.extend({
name : DS.attr('string'),
@nicobytes
nicobytes / pipelines.yml
Created October 6, 2017 04:04
Install chrome for CI
image: node:6.9.4
pipelines:
branches:
master:
- step:
script:
- apt-get update; apt-get install -y gettext-base;
- echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
- set -x && apt-get update && apt-get install -y xvfb google-chrome-stable
; Comments start with semicolons.
; Clojure is written in "forms", which are just
; lists of things inside parentheses, separated by whitespace.
;
; The clojure reader assumes that the first thing is a
; function or macro to call, and the rest are arguments.
;
; Here's a function that sets the current namespace:
(ns test)
@samselikoff
samselikoff / future-proof.md
Last active April 21, 2023 17:14
Future-proofing your Ember 1.x code

This post is also on my blog, since Gist doesn't support @ notifications.


Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:

  • Use Ember CLI
  • In general, replace views + controllers with components
  • Only use controllers at the top-level for receiving data from the route, and use Ember.Controller instead of Ember.ArrayController or Ember.ObjectController
  • Fetch data in your route, and set it as normal properties on your top-level controller. Export an Ember.Controller, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.
@jasonrudolph
jasonrudolph / about.md
Last active January 6, 2024 07:40
Programming Achievements: How to Level Up as a Developer