Skip to content

Instantly share code, notes, and snippets.

@adriennetacke
adriennetacke / countdown.js
Last active September 1, 2022 04:18
Countdown timer in pure JavaScript
function countdown(endDate) {
let days, hours, minutes, seconds;
endDate = new Date(endDate).getTime();
if (isNaN(endDate)) {
return;
}
setInterval(calculate, 1000);
@inecmc
inecmc / vue-history-prerender-nginx.md
Created March 2, 2018 06:54
Nginx config for Vue.js history mode + Prerender.io
# Force to use https
server {
    listen 80;
    listen [::]:80;
    server_name example.com;
    return 301 https://$server_name$request_uri;
}

# Default server configuration
<div class="container">
<h1>Add New User</h1>
<form (ngSubmit)="userSubmit()" #addform="ngForm">
<div class="form-group">
<label for="firstname">FirstName</label>
<input type="text" [(ngModel)]="model.firstname" name="firstname" class="form-control" id="firstname" required #firstname="ngModel">
</div>
@qzm
qzm / Jenkinsfile
Last active December 7, 2024 13:22
Vue.js / Jenkinsfile /Pipelines
pipeline {
agent {
docker {
image 'node'
}
}
stages {
stage('Clone Sources') {
steps {

I’m looking forward to the Sass Fundamentals workshop! A few notes to ensure you’re set up in advance are below.

See you soon!

Mike

Node.js

You’ll need a relatively recent version (v4.5 or newer, v7 ideally) of node.js installed. On OS X, a great way of doing this without disturbing your existing dev environment is to install NVM. Installation instructions are here.

@mediavrog
mediavrog / gist:49c4f809dffea4e00738a7f5e3bbfa59
Last active June 20, 2024 18:13
CORS in Google Cloud Functions for Firebase
const cors = require('cors')({origin: true});
exports.sample = functions.https.onRequest((req, res) => {
cors(req, res, () => {
res.send('Passed.');
});
});
@arasharchor
arasharchor / DeepLearningFaces.md
Created January 15, 2017 14:51 — forked from jdsgomes/DeepLearningFaces.md
Deep Learning for Face Recognition

Deep Learning for Face Recognition (May 2016)

Popular architectures

  • FaceNet (Google)
    • They use a triplet loss with the goal of keeping the L2 intra-class distances low and inter-class distances high
  • DeepID (Hong Kong University)
    • They use verification and identification signals to train the network. Afer each convolutional layer there is an identity layer connected to the supervisory signals in order to train each layer closely (on top of normal backprop)
  • DeepFace (Facebook)
    • Convs followed by locally connected, followed by fully connected
@Omranic
Omranic / pwa-serviceworker-appshell.md
Last active March 5, 2025 04:13
2. Use service workers to pre-cache the App Shell - Your First Progressive Web App
@karpathy
karpathy / min-char-rnn.py
Last active July 16, 2025 02:33
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@irisli
irisli / twitterDateFormat.js
Created February 20, 2015 00:58
Twitter Date Format
// This formats dates like how Twitter does on their tweets I originally wrote
// this because I did not want to add an external dependency (such as moment) to
// my project for something so insignificant (date format). I couldn't have
// easily generated it on the server side since the dates are relative to the
// end user's browser's timezone (and I specifically wrote this to run on the
// client).
//
// Usage: twitterDateFormat(time)
// time can be anything JS' Date can understand