Skip to content

Instantly share code, notes, and snippets.

View goelinsights's full-sized avatar

Vijay Goel goelinsights

View GitHub Profile
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
//Options
// Use this if you want to exclude some campaigns. Case insensitive.
// For example ["Brand"] would ignore any campaigns with 'brand' in the name,
// while ["Brand","Competitor"] would ignore any campaigns with 'brand' or
// 'competitor' in the name.
// Leave as [] to not exclude any campaigns.
var campaignNameDoesNotContain = [];
@mzaidannas
mzaidannas / Simple Docker Setup with Rails+Nginx+Redis+Postgres.md
Last active March 26, 2024 19:55
Simple Docker Setup with Rails+Nginx+Redis+Postgres.md

Typical rails setup with docker+puma+nginx+postgres

Zaid Annas

Devsinc inc. 30/08/2018

Overview

@sulmanweb
sulmanweb / _document.json.jbuilder
Created May 13, 2018 08:04
Active Storage as Attachment in Rails API with base64 decoding
json.extract! document, :id, :documentable_type, :documentable_id, :created_at
json.url rails_blob_url(document.doc)
@satendra02
satendra02 / app.DockerFile
Last active March 3, 2024 10:13
docker+rails+puma+nginx+postgres (Production ready)
FROM ruby:2.3.1
# Install dependencies
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
# Set an environment variable where the Rails app is installed to inside of Docker image:
ENV RAILS_ROOT /var/www/app_name
RUN mkdir -p $RAILS_ROOT
# Set working directory, where the commands will be ran:
@bennadel
bennadel / app.component.ts
Created November 6, 2017 00:13
Lazy Loading Images With The IntersectionObserver API In Angular 5.0.0
// Import the core angular services.
import { Component } from "@angular/core";
// ----------------------------------------------------------------------------------- //
// ----------------------------------------------------------------------------------- //
interface Contact {
id: number;
name: string;
avatarUrl: string;
@keathmilligan
keathmilligan / auth0-angular-cli-notes.md
Last active March 20, 2018 20:56
auth0 + angular-cli notes

Auth0 Example with Angular CLI

A complete example is available at https://github.com/keathmilligan/angular2-cli-auth0-example

The provided auth0 tutorial uses SystemJS, these notes outline how to integrate into an angular-cli or straight webpack project.

Create project as usual with "ng create".

Install auth0 packages & bootstrap:

@btroncone
btroncone / ngrxintro.md
Last active February 9, 2024 15:37
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

import {Directive, forwardRef, Provider} from "angular2/core";
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from "angular2/common";
import {CONST_EXPR} from "angular2/src/facade/lang";
const FILE_VALUE_ACCESSOR = CONST_EXPR(
new Provider(NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => FileControlValueAccessor), multi: true})
);
/**
* The accessor for listening to changes that is used by the
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
@dsaronin
dsaronin / gist:8155622
Last active March 22, 2017 07:09
token_authentication handling using milia & devise
## token_authentication
# at the head of of controllers which will need token authentication instead of password/session authentication:
skip_before_action :authenticate_tenant!
before_action :authenticate_by_token!
# then in application_controller.rb:
def authenticate_by_token!