Skip to content

Instantly share code, notes, and snippets.

View sophiabrandt's full-sized avatar

Sophia Brandt sophiabrandt

View GitHub Profile
##! /bin/bash
# modified script for streaming on Linux via ffmpeg.
# Original see here: https://gist.github.com/oseparovic/2db2aaa737cd37e7c068
# see http://ubuntuguide.org/wiki/Screencasts for full documentation
# see http://www.thegameengine.org/miscellaneous/streaming-twitch-tv-ubuntu/
# for instructions on how to use this gist
if [ ! -f ~/.twitch_key ]; then
echo "Error: Could not find file: ~/.twitch_key"
@sophiabrandt
sophiabrandt / fcc_caesars_cipher_1.js
Last active March 29, 2016 10:31
Free Code Camp Basic Algorithms
function rot13(str) {
var map = Array.prototype.map;
var a = map.call(str, function(x) {
return x.charCodeAt(0);
});
var b = a.map(function(y) {
if (y > 64) {
var z = y + 13;
if (z > 90) {
return z - 26;
@sophiabrandt
sophiabrandt / fcc_caesars_cipher_2.js
Last active March 29, 2016 10:29
Free Code Camp Basic Algorithms
function rot13(str) {
return str.split('').map(shiftLetters).join('');
function shiftLetters(letter) {
var charCode = letter.charCodeAt(0);
var shift13 = charCode + 13;
var over90 = 64 + (shift13 - 90);
return String.fromCharCode(charCode <= 64 ? charCode : shift13 > 90 ? over90: shift13);
}
function sumAll(arr) {
var min = Math.min.apply(null, arr),
max = Math.max.apply(null, arr),
newArr = [],
i;
for (i = min; i <= max; i++) {
newArr.push(i);
}
return newArr.reduce(function (a,b) {
return a+b;
function sumAll(arr) {
var max = Math.max(arr[0], arr[1]);
var min = Math.min(arr[0], arr[1]);
var temp = 0;
for (var i=min; i <= max; i++){
temp += i;
}
return(temp);
}
function convertToRoman(num) {
// create an ES6-map
const romanNumbers = new Map()
.set(1000, 'M')
.set(900, 'CM')
.set(500, 'D')
.set(400, 'CD')
.set(100, 'C')
.set(90, 'XC')
@sophiabrandt
sophiabrandt / README.md
Created November 15, 2018 15:11 — forked from akashnimare/README.md
A Beginners Guide to writing a Kickass README ✍

Project title

A little info about your project and/ or overview that explains what the project is about.

Motivation

A short description of the motivation behind the creation and maintenance of the project. This should explain why the project exists.

Build status

Build status of continus integration i.e. travis, appveyor etc. Ex. -

Build Status

@sophiabrandt
sophiabrandt / truthy-falsy.md
Created February 18, 2019 13:30
Truthy and Falsy Values in JavaScript, Python and Clojure/ClojureScript
JavaScript Python 3 Clojure/ClojureScript
Falsy false False false
null None nil
NaN
undefined
0 (zero) 0
0.0 0.0
"" (empty string) "" (empty string)
[] (empty list)
# compile with `nim c -d:ssl readme_template_downloader.nim`
import httpclient, parseopt, os
proc downloadTemplate(link: string) =
var client = newHttpClient()
try:
var file = open("README.md", fmWrite)
defer: file.close()
file.write(client.getContent(link))

Foobar

Foobar is a Python library for dealing with word pluralization.

Installation

Use the package manager pip to install foobar.

pip install foobar