Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Golightly magician11

View GitHub Profile
@jozsefDevs
jozsefDevs / validation_curry.js
Created Oct 22, 2013
A simple way to implement a validation by JavaScript currying
View validation_curry.js
var above = function(limit){
return function(value){
return value > limit;
};
};
var isAbove10 = above(10);
console.log(isAbove10(5)); // false
console.log(isAbove10(8)); // false
View boyer_resume.md

Carleen Michele Boyer

carleenboyer@gmail.comhttp://github.com/carleen • (+66) 094-762-7778

##SUMMARY With four years’ experience in laboratory research, I am a passionate experimental physicist with strong analytical skills. My work includes the fields of fluid dynamics, chaos theory, and astrophysics. I am accustomed to various group dynamics, working under supervision, and managing projects independently. I aim to apply my skills, knowledge, and previous work experience to a high-energy work environment.

##WORK EXPERIENCE

@magician11
magician11 / front-end.js
Last active Aug 2, 2017
How To Use jQuery To Post A CSV File To A Node.js Server
View front-end.js
// using jQuery
$("#2020data").submit(function(e) {
$.ajax({
url: "https://e0d92634.ngrok.io/test",
type: "POST",
data: new FormData(this),
processData: false,
contentType: false
});
@Gattermeier
Gattermeier / config.js
Last active Oct 3, 2017
NODE ENV config
View config.js
// var config = require('./config.js').get(process.env.NODE_ENV);
var config = {
production: {
session: {
key: 'the.express.session.id',
secret: 'something.super.secret'
},
database: 'mongodb://<user>:<pwd>@apollo.modulusmongo.net:27017/db',
twitter: {
@magician11
magician11 / config.js
Last active Dec 2, 2017
How to send an email from Node.js using Gmail
View config.js
module.exports = {
email: {
address: 'youraddress@gmail.com',
password: 'clever-password'
}
};
@magician11
magician11 / my-domain.com.conf
Last active Jan 19, 2018
How to add pre and post hooks for Certbot automatic renewals running Nginx
View my-domain.com.conf
# renew_before_expiry = 30 days
version = 0.19.0
archive_dir = /etc/letsencrypt/archive/my-domain.com
cert = /etc/letsencrypt/live/my-domain.com/cert.pem
privkey = /etc/letsencrypt/live/my-domain.com/privkey.pem
chain = /etc/letsencrypt/live/my-domain.com/chain.pem
fullchain = /etc/letsencrypt/live/my-domain.com/fullchain.pem
# Options used in the renewal process
[renewalparams]
@DavidWells
DavidWells / webpack-cssloader-keyframes-example
Created Sep 25, 2015
Example of how to use keyframes in webpack with css-loader + postcss
View webpack-cssloader-keyframes-example
:global {
.test {
position: absolute;
width:30px;
height:30px;
background: red;
display: block;
left:0px;
&:hover{
transform: rotateY(0deg);
@magician11
magician11 / nodejs-cron.js
Last active May 1, 2018
How to get a Node.js function to run once on the last day of each month
View nodejs-cron.js
const moment = require('moment');
const someAction = () => console.log('Actioning...');
const wait = ms => new Promise((resolve, reject) => setTimeout(resolve, ms));
const startCron = async () => {
while (true) {
if (
moment().date() ===
@magician11
magician11 / currency-conversion.html
Last active Aug 21, 2018
How To Create Your Own Currency Conversion App
View currency-conversion.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Currency Conversion</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
@magician11
magician11 / remove-duplicates.js
Last active Dec 28, 2018
How to remove duplicates in a csv field
View remove-duplicates.js
const removeDuplicates = csvStr => [...new Set(csvStr.split(',').map(tag => tag.trim()))].join(', ');
You can’t perform that action at this time.