Skip to content

Instantly share code, notes, and snippets.

View sheminusminus's full-sized avatar
🤖
Disco

Emily Presser sheminusminus

🤖
Disco
View GitHub Profile
function factorial(n) {
if (n < 0 || typeof n != 'number')
{ return null; }
if (n === 0)
{ return 1;}
for (var i = n - 1; i > 0; i--)
{ n *= i; }
return n;
}
@sheminusminus
sheminusminus / svgCalc.js
Last active April 21, 2016 16:54
svg elements to html <select> and your calculator maths
window.addEventListener('load', function() {
// array for <select>s
var selects = [];
// array for svg elements you want the <select>s to be swapped-in for
var boxes = [document.querySelector('#swapForNames'), document.querySelector('#swapForDistances')];
// make <select> elements, append them, set positions
boxes.forEach(function(box, idx) {
var sel = document.createElement('select');
function myFunction() {
function firstGuy() {
return 'first one';
}
function secondGuy() {
return 'second one';
}
function thirdGuy() {
return 'third one';
}
git clone https://github.com/sheminusminus/deana.ninja
@sheminusminus
sheminusminus / Home.jsx
Last active February 2, 2017 14:01
Style updates for the full-page background image effect (.jsx for the syntax highlighting)
import React, {Component} from 'react';
import ReactDOM from 'react-dom';
// this url will need to be relative the the index.html file
// or you can a webpack image-loader for using urls relative to src files
const background = './shutterstock_383791612.jpg';
const sectionStyle = {
// i'm using vw and vh here, but it's a personal preference
// percentages will also work if you give the parent container some dimensions
@sheminusminus
sheminusminus / ViewController.swift
Created March 4, 2017 02:55
introductory view controller class
//
// ViewController.swift
// Norberto
//
// Created by Emily Kolar on 3/3/17.
// Copyright © 2017 emilykolar. All rights reserved.
//
import UIKit
<?php
$actual_link = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$path = parse_url($actual_link)['path'];
?>
<div id= "menu">
<ul>
<li><a class="<?php if ($path == '/home.php') { echo 'active'; }?>" href="home.php">Home</a></li>
<li><a class="<?php if ($path == '/tv.php') { echo 'active'; }?>" href="tv.php">TV</a></li>
<li><a class="<?php if ($path == '/watch.php') { echo 'active'; }?>" href="watch.php">Watch</a></li>
<li><a class="<?php if ($path == '/laptop.php') { echo 'active'; }?>" href="laptop.php">laptop</a></li>
{
"development": {
"username": "",
"password": "",
"database": "",
"host": "localhost",
"dialect": "mysql"
},
"test": {
"username": "",
const path = require('path');
module.exports = {
'config': path.resolve(__dirname, 'seq.json'),
'migrations-path': path.resolve(__dirname, 'db/migrations'),
'models-path': path.resolve(__dirname, 'db/models'),
'seeders-path': path.resolve(__dirname, 'db/seeders'),
};
@sheminusminus
sheminusminus / eventRouter.js
Last active September 10, 2017 23:53
Events: 1. Create an event 2. Make a form that allows others to update that event
/**
* eventRouter.js
* @file Handles any requests to route /api/events. Server file.
*/
const axios = require('axios');
const router = require('express').Router();
// events the user can alter, seeded with event 2
// of course this would normally come from a database