Skip to content

Instantly share code, notes, and snippets.

View PatrickHeneise's full-sized avatar
🏡
Working remote

Patrick Heneise PatrickHeneise

🏡
Working remote
View GitHub Profile
@simenbrekken
simenbrekken / uploader.js
Created May 2, 2012 13:38
Fetch, resize via ImageMagick and store image on Amazon S3 with node.js
var spawn = require('child_process').spawn,
aws2js = require('aws2js'),
http = require('http'),
urlutil = require('url')
mime = require('mime'),
Buffers = require('buffers');
var settings = {
s3: {
key: 'key',
@SimplGy
SimplGy / addFileToGit.js
Last active October 6, 2021 12:38
Usage: `addFileToGit(foo.txt, "some file contents")`. Uses the "octokit" to add a single file to your gitub repo. Adapted from a Ruby guide by http://mattgreensmith.net
const Octokit = require('@octokit/rest'); // https://octokit.github.io/rest.js/
// Customize this stuff:
const auth = 'your-key-generated-in-github-ui'; // PRIVATE!
const owner = 'repo-owner';
const repo = 'your-repo-name';
// Constants
const userAgent = 'git commiter v1';
const ref = 'heads/master';