Skip to content

Instantly share code, notes, and snippets.

@smhatre59
smhatre59 / fileupload.js
Last active July 1, 2020 19:24
File upload using reactjs
import React, { Component } from 'react';
import './App.css';
/*
Screen:LoginScreen
Loginscreen is the main screen which the user is shown on first visit to page and after
hitting logout
*/
import LoginScreen from './Loginscreen';
/*
Module:Material-UI
@cpsubrian
cpsubrian / db.js
Last active June 13, 2023 06:59
Mock knex database for Jest
/* eslint-env jest */
import _ from 'lodash'
import path from 'path'
import fs from 'fs'
import callsites from 'callsites'
import knex from 'knex'
import hash from 'object-hash'
import conf from '<conf>'
// Get the db config.
@sirkkalap
sirkkalap / Install-Docker-on-Linux-Mint.sh
Last active December 8, 2022 18:38
Install Docker on Linux Mint
##########################################
# To run:
# curl -sSL https://gist.githubusercontent.com/sirkkalap/e87cd580a47b180a7d32/raw/d9c9ebae4f5cf64eed4676e8aedac265b5a51bfa/Install-Docker-on-Linux-Mint.sh | bash -x
##########################################
# Check that HTTPS transport is available to APT
if [ ! -e /usr/lib/apt/methods/https ]; then
sudo apt-get update
sudo apt-get install -y apt-transport-https
fi
#!/bin/bash
sudo apt-get install build-essential -y
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update -y
sudo apt-get install nodejs -y
sudo apt-get install mongodb -y
sudo apt-get install git -y
sudo apt-get install nginx -y
sudo apt-get install htop -y
#!/bin/bash -x
useradd -m NibblesAndBits
sudo apt-get install build-essential -y
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update -y
sudo apt-get install nodejs -y
sudo apt-get install mongodb -y
sudo apt-get install couchdb -y
Meteor.startup () ->
# Countries collection initialization.
countries_csv = Assets.getText('country.csv')
csv = Meteor.require('csv')
countries_count = Countries.find().count()
if countries_count is 0
Future = Npm.require('fibers/future')
future = new Future()
csv()
.from.string(countries_csv, {comment: '#'})
@Stanback
Stanback / nginx.conf
Last active May 3, 2024 12:01 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@lpar
lpar / REST.xsp
Last active July 21, 2023 20:16
Minimal example of a 4-verb REST service in IBM Domino XPages, with no external dependencies.
<?xml version="1.0" encoding="UTF-8"?>
<!-- XPages source for REST service. -->
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" rendered="false">
<xp:this.afterRenderResponse><![CDATA[#{javascript:
com.ath0.xrest.Service.dispatch();
}]]></xp:this.afterRenderResponse>
</xp:view>