Skip to content

Instantly share code, notes, and snippets.

View J3698's full-sized avatar
๐Ÿ›
Inch Worm

Anti J3698

๐Ÿ›
Inch Worm
  • Working
  • Working
View GitHub Profile
const express = require('express'); // import express
const app = express();
/*
* A deployment service might set a correct PORT
* to use, if no port is set 5000 will probably
* be free for use.
*/
const port = process.env.PORT || 5000;
@J3698
J3698 / App.js
Last active June 24, 2019 01:58
import React, { Component } from 'react';
import './App.css';
class App extends Component {
constructor(props) {
super(props);
this.state = {dataText: "data not yet recieved"};
}
// this is called once the component is rendered at least once
import React, { Component } from 'react';
import styles from './input-box.module.css';
class UrlInput extends Component {
render() {
return(
<div className={styles.shortenOptions}>
<input type="text" placeholder="url to shorten" className={styles.urlInput} tabIndex="1" />
<button className={styles.shortenButton} tabIndex="3">shorten</button>
<br />
@J3698
J3698 / App.js
Created July 22, 2019 01:00
UrlMem App.js
import React, { Component } from 'react';
import UrlShortening from './UrlShortening.js';
import './App.css';
class App extends Component {
render() {
return (
<div className="App">
<div className="Header">
<a className="blogButton" href="https://antiprojects.com/urlmem.html">Blog</a>
function UrlOutput(props) {
return (
<>
<div className={outputStyles.shortenOutput}>
<div className={outputStyles.siteName}>
urlmem.com/
</div>
<div className={outputStyles.shortWord}>
{props.shortUrl}
</div>
@J3698
J3698 / .newvimrc
Last active November 16, 2019 02:27
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@J3698
J3698 / vim8_on_andrew
Last active March 22, 2020 20:45
Install vim with autocomplete
#!/usr/bin/env bash
# clone vim and vundle
cd ~
git clone https://github.com/vim/vim.git
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
# build vim
cd vim
git checkout a21df1db3ca619afdcb47931af042508a6bbc8e5
renderOutputs() {
return (
<TransitionGroup>
{this.state.shortenedUrls.map(UrlPair =>
<CSSTransition
key={UrlPair.id}
timeout={300}
classNames='latestOut'
>
<UrlOutput longUrl={UrlPair.longUrl}
// GET route for custom URLs
app.get('/custom', (req, res) => {
// sanitize input
if (typeof (req.query.longUrl) !== "string" ||
typeof (req.query.customUrl) !== "string") {
res.send({"shortened": null});
return;
}
let longUrl = qualify(req.query.longUrl);
#.env
GENERATE_SOURCEMAP=false