Skip to content

Instantly share code, notes, and snippets.

View Epotignano's full-sized avatar
🎯
Focusing

Emiliano Potignano Epotignano

🎯
Focusing
View GitHub Profile
@Epotignano
Epotignano / usingSomeForFilter.js
Last active September 12, 2015 15:00
Using the array.some method for a filter.
.constant('geslachtOptions', [
{'value': 'M', 'label': 'Man'},
{'value' : 'V', 'label': 'Vrouw'},
{'value': 'O', 'label': 'Onbekend'}
])
.filter('geslachtFilter', function(geslachtOptions){
return function(input) {
if(input) {
/**
* Created by emiliano on 04/02/15.
*/
angular.module('exampleApp.auth')
.service('AuthTokenService', function AuthTokenService(gettext, $state, $localStorage, $firebaseAuth, $firebaseObject, $q, $window, fireRef, UserService) {
var service = this;
var ref = new Firebase(fireRef);
var auth = $firebaseAuth(ref);
module app.services {
interface ICoursesService {
getCollection():void;
get(courseId);
create(courseObj);
update(courseObj, courseId);
remove(courseId);
}
@Epotignano
Epotignano / gatsby-config-example.js
Last active November 23, 2019 05:06
gatsby-config for integrate Prismic and Gatsby Image
plugins: [
/**
Something else that you have in your config
**/
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
<script>
import { stores } from '@sapper/app';
import { onMount } from 'svelte';
import {loadStripe} from '@stripe/stripe-js';
let paymentToken = '';
let paymentError;
const { preloading, page, session } = stores();
$ : unitName = ($page.params && $page.params.unitName) ? $page.params.unitName[0] : ''; // The reactive part here I read the params to know about what is the selected unit by the user
@Epotignano
Epotignano / typeform-page.tsx
Last active December 21, 2021 03:44
Embed Typeform UTM Tracking
import React, { useEffect, useState } from 'react';
import Script from "next/script";
const getURLParams = () => {
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
return urlParams;
}
// Simple function
const getURLParams = () => {
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
return urlParams;
}
// Usage
const exampleURLParams = getURLParams();