Skip to content

Instantly share code, notes, and snippets.

View anabellaspinelli's full-sized avatar

Anabella anabellaspinelli

  • Barcelona, Spain
View GitHub Profile
@anabellaspinelli
anabellaspinelli / app-1.js
Last active September 22, 2018 18:14
Typeform OAuth Tutorial
const express = require('express')
const path = require('path')
const app = express()
app.set('view engine', 'ejs')
app.set('views', path.join(__dirname, '/views'))
/* Routes */
app.get('/', (req, res) => res.render('home'))
.nigiri-plate {
background-color: #223;
box-shadow: inset -8px -8px 0 0 #558;
border-radius: 20px;
height: 105px;
}
.nigiri-plate:after {
content: "";
clear: both;
@anabellaspinelli
anabellaspinelli / setup-https-remote.md
Last active July 30, 2018 09:46
Set up an https remote

Add an HTTPS remote for origin

Intro

If you're having the all time classic Broken pipe: the remote hung up unexpectedly error, a quick way to solve it is switching your computer to another wifi network (like the one your smartphone can provide).

But if this keeps happening it's a pain to have to do it constantly. So another solution can be to set up a new remote (the thing that knows where the GitHub repo is), but this time through https instead of ssh. This way, if you get the broken pipe, you can patch it up in a single command.

Steps

  1. Go to the repo in GitHub
  2. Select Clone or Download
  3. Select Use HTTPS
window.onload = function() {
var loginButton = document.createElement('a')
var loginButtonImg = document.createElement('img')
var dataset = document.querySelector('script[name=tf-login]').dataset
console.log(dataset['redirect_uri'])
var oauthUrl =
'https://api.typeform.com/oauth/authorize?client_id='
@anabellaspinelli
anabellaspinelli / sushi-markup-2.html
Last active July 24, 2018 14:53
Nigiris with a plate container
<html>
<body>
<div class="nigiri-plate">
<div class="board">
<div class="nigiri">
<h1>/ / / / /</h1>
</div>
<div class="nigiri">
<h1>/ / / / /</h1>
</div>
.nigiri-plate {
background-color: #223;
border-radius: 20px;
}
.nigiri-plate:after {
content: "";
display: block;
clear: both
}
.nigiri {
margin: 0 10px; /* fixed 10px margin and padding... for now! */
padding: 0 10px;
float: left;
/* Extra things to makit look nice */
background-color: #fff;
border-radius: 100px;
box-shadow: inset -3px -6px 0 0 #ece0cd;
}
<html>
<body>
<div class="board">
<div class="nigiri">
<h1>/ / / / /</h1>
</div>
<div class="nigiri">
<h1>/ / / / /</h1>
</div>
<div class="nigiri">
@anabellaspinelli
anabellaspinelli / accent-words.js
Created July 17, 2018 17:04
Logic behind graphical accents in Spanish
const endingLetters = ['n', 's', 'a', 'e', 'i', 'o', 'u']
const accentWord = myWord => {
let syllables = WordUtils.splitIntoSyllables(myWord)
let numberOfSyllables = syllables.length
if ( WordUtils.getWordType(myWord) === 'esdrújula' ) {
syllables[numberOfSyllables - 3].addAccent() // example: o RÉ ga no || bo LÍ gra fo
return syllables.join('')
}
/* Two elements in the row */
.two.shoulder {
width: 48%;
padding: 1%;
}
.two.spaced {
width: 46%;
padding: 1%;