Skip to content

Instantly share code, notes, and snippets.

View developius's full-sized avatar

Finnian Anderson developius

View GitHub Profile
@developius
developius / README.md
Last active April 25, 2024 22:15
Setup SSH keys for use with GitHub/GitLab/BitBucket etc

Create a new repository, or reuse an existing one.

Generate a new SSH key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings (https://github.com/settings/keys).

Test SSH key:

@developius
developius / README.md
Last active May 23, 2022 09:37
React Native + Ruby on Rails + AWS S3 Presigned PUT
@developius
developius / README.md
Last active July 23, 2021 04:31
Google Cloud Storage example CORS configuration for Rails/ActiveStorage

This gist shows you how to configure a Google Cloud Storage bucket CORS for use with Rails' ActiveStorage (or any other direct-upload mechanism).

  1. Update the policy JSON to reflect your setup (likely only changing the origin parameter)
  2. Run this: $ gsutil cors set ./cors-json-file.json gs://<bucket-name>
@developius
developius / GitHub-stats.js
Created March 23, 2015 22:10
jQuery functions to get data about a GitHub repository
jQuery.githubUser = function(username, callback) {
jQuery.getJSON('https://api.github.com/users/'+username+'/repos?callback=?',callback)
}
jQuery.githubRepoContributors = function(username, repo, callback) {
jQuery.getJSON('https://api.github.com/repos/'+username+'/'+repo+'/contributors'+'?callback=?',callback)
}
jQuery.githubOrgMembers = function(org,callback){
jQuery.getJSON('https://api.github.com/orgs/' + org + '/public_members?callback=?',callback)
@developius
developius / Dockerfile
Last active May 9, 2018 18:18 — forked from alexellis/Dockerfile
Sentiment Analysis function for FaaS
FROM python:2.7-alpine
RUN pip install textblob
RUN python -m textblob.download_corpora
ADD https://github.com/alexellis/faas/releases/download/0.5.1-alpha/fwatchdog /usr/bin
RUN chmod +x /usr/bin/fwatchdog
WORKDIR /root/
COPY handler.py .
@developius
developius / Dockerfile
Created November 4, 2017 16:33
ffmpeg + opencv dockerfile
FROM python:2.7
RUN apt-get update -qy && apt-get install -qy libmp3lame-dev libopenjpeg-dev pkg-config yasm libav-tools libspeex-dev libtheora-dev libvorbis-dev libx264-dev
WORKDIR /root
RUN wget http://ffmpeg.org/releases/ffmpeg-3.4.tar.bz2
RUN tar xvjf ffmpeg-3.4.tar.bz2
WORKDIR /root/ffmpeg-3.4
Verifying that +developius is my blockchain ID. https://onename.com/developius
@developius
developius / .bashrc
Last active June 1, 2016 11:52 — forked from popey456963/.bashrc
Bash RC File
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@developius
developius / compare.js
Last active December 7, 2015 20:55
Node vs PHP vs Python
console.log("--- Node.js ---");
var a = "email@correct.com";
var b = "wrong";
var reg = /(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?
@developius
developius / debugging.func.php
Last active October 22, 2015 11:49
Useful PHP debugging functions
This code is licensed under the Apache 2.0 license available here: http://www.apache.org/licenses/LICENSE-2.0.html
function debug($a) {
if (is_string($a) || is_int($a)) {
echo $a."<br>";
}
else {
echo "<pre>";
print_r($a);
echo "</pre>";