Skip to content

Instantly share code, notes, and snippets.

View Epotignano's full-sized avatar
🎯
Focusing

Emiliano Potignano Epotignano

🎯
Focusing
View GitHub Profile
// Simple function
const getURLParams = () => {
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
return urlParams;
}
// Usage
const exampleURLParams = getURLParams();
@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;
}
<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 / 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`,
module app.services {
interface ICoursesService {
getCollection():void;
get(courseId);
create(courseObj);
update(courseObj, courseId);
remove(courseId);
}
/**
* 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);
@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) {
var selectCtrl = function($element) {
var ctrl = this;
$element.on('click', function(e){
//use a method that I have to see in the docs for select the text in an input that I don't remember now, should be accesible
//$element
})
};
/*** inside Angular **/
var someService = function($q, $http) {
var service = this;
service.findSomething = function(query) {
var somePromise = $q.defer()
$http.get(/*something well done here */).then(function(data){
somePromise.resolve(data);
<nav-bar>
<dropdown class="visible-sm"></dropdown>
</nav-bar>
<side-bar class="col-md-3 hidden-sm">
<!--- elements of the menu -->
</side-bar>
<div class="container-fluid">
<div class="row">
<!-- the messages -->