Skip to content

Instantly share code, notes, and snippets.

View hantsy's full-sized avatar
🏠
Working from home

Hantsy Bai hantsy

🏠
Working from home
View GitHub Profile
@mseemann
mseemann / reactiveform.component.ts
Last active October 13, 2019 06:40
Reactive Forms Example(ts)
import {
Component,
OnInit
} from '@angular/core';
import { flyInOutTrigger } from './../animations/flyInOutTrigger-animation';
import { hostConfig } from './../animations/flyInOutTrigger-animation';
import {
FormGroup,
FormControl,
Validators,
@wesleygrimes
wesleygrimes / upgrading-to-angular-ngrx-8.md
Created June 12, 2019 19:17
Upgrading to Angular v8 and NgRx v8

Upgrading to Angular 8 and NgRx 8

Overview

Do you have an awesome application written with Angular v7 using NgRx v7, but have been feeling left out will all the mentions online and at conferences about Angular v8 and NgRx v8? Well you are in luck! Today we will explore together, how to upgrade our applications to use Angular v8 using the Angular CLI tooling. We will also explore upgrading to NgRx v8. This will allow us to take advantage of the new features provided in NgRx v8. Included with NgRx v8 is a shiny set of creators, or type-safe factory functions, for actions, effects, and reducers.

Upgrading Dependencies

Upgrading Angular

The Angular team has provided a great website that walks through the process of upgrading in-depth. This website can be found at Angular Update Tool. We will touch on some of the information today.

@abeisgoat
abeisgoat / ImageUpload.js
Last active January 30, 2020 15:54
An example of image uploading using Firebase with AngularFire.
angular.module('app')
.controller('ImageUpload', ['$scope', '$log',
function ImageUpload($scope, $log) {
$scope.upload_image = function (image) {
if (!image.valid) return;
var imagesRef, safename, imageUpload;
image.isUploading = true;
imageUpload = {
@jmkgreen
jmkgreen / keycloak-compose.yml
Created August 3, 2017 09:01
KeyCloak docker-compose file for swarm stack launch purposes
version: '3.3'
services:
keycloak:
image: jboss/keycloak-mysql
environment:
- constraint:serverclass==gateway
- PROXY_ADDRESS_FORWARDING=true
- MYSQL_USER=keycloak
@faizanakram99
faizanakram99 / ArgumentResolverTest.php
Last active October 13, 2021 13:07
RequestDTOArgumentValueResolver
<?php
namespace Qbil\Tests\CommonBundle\Services;
use Qbil\CommonBundle\Services\DTOArgumentValueResolver;
use Qbil\Tests\Fixtures\Controller\DTOController;
use Qbil\Tests\Fixtures\DTO\Person;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Controller\ArgumentResolver;
@rponte
rponte / some_links.md
Last active January 19, 2022 07:48
Some interesting articles about JPA/Hibernate Multi-Tenancy

Getting Started in Scala

This is my attempt to give Scala newcomers a quick-and-easy rundown to the prerequisite steps they need to a) try Scala, and b) get a standard project up and running on their machine. I'm not going to talk about the language at all; there are plenty of better resources a google search away. This is just focused on the prerequisite tooling and machine setup. I will not be assuming you have any background in JVM languages. So if you're coming from Python, Ruby, JavaScript, Haskell, or anywhere…  I hope to present the information you need without assuming anything.

Disclaimer It has been over a decade since I was new to Scala, and when I was new to Scala, I was coming from a Java and Ruby background. This has probably caused me to unknowingly make some assumptions. Please feel free to call me out in comments/tweets!

One assumption I'm knowingly making is that you're on a Unix-like platform. Sorry, Windows users.

Getting the JVM

@enleur
enleur / ConstraintViolationsConverter.php
Last active May 18, 2022 10:31
Symfony json body to request object auto mapping
<?php
namespace App\Request\ParamConverter;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Validator\ConstraintViolationListInterface;
final class ConstraintViolationsConverter implements ParamConverterInterface
@jkuipers
jkuipers / formMacros.ftl
Last active June 21, 2022 13:43
FreeMarker macros for rendering Bootstrap horizontal form inputs in Spring-MVC applications
<#ftl strip_whitespace=true>
<#import "spring.ftl" as spring />
<#-- This file contains form-related macros for use in the other Freemarker template files.
The generated HTML is intended for use with Twitter Bootstrap based forms. -->
<#--
* radioButtons
*
* @param path the name of the field to bind to
@rajagp
rajagp / custom_couchbase_dev_image.md
Last active October 25, 2022 09:47
Steps to create a custom Couchbase Server Docker Image for development

Purpose

Follow the steps below if you are interested in creating your own custom configurable Couchbase docker image. You will start off with the official Couchbase Enterprise docker image that is available on Docker Hub and use the Couchbase CLI and REST interface to create a custom configurable image.

Credits

This approach inspired by the tutorial. We essentially built a custom docker image from the base Coucbase server image that is configured for our development needs!

Steps

  • Create a new file named DockerFile and open it using an editor of your choice
  • Now add the following lines to the DockerFile.