Skip to content

Instantly share code, notes, and snippets.

View Borgaard's full-sized avatar

Nicole Borgaard Borgaard

  • General Assembly
  • San Francisco, CA
View GitHub Profile
@heloa-net
heloa-net / How-to.md
Created January 4, 2017 01:58
Hiding API keys on GitHub without breaking your project

Backup the API key beforehand in case you have trouble reverting the file.

Let's say the file with a key you want to hide is <filename> Open it and change the API key with a placeholder, like <api-key> Save and add the file to git and commit git commit -m 'Masking API key'

Then revert the file, undoing recent changes so your key is back where it should be and save it. Use git update-index --assume-unchanged

## How to hide API keys from github ##
1. If you have already pushed commits with sensitive data, follow this guide to remove the sensitive info while
retaining your commits: https://help.github.com/articles/remove-sensitive-data/
2. In the terminal, create a config.js file and open it up:
touch config.js
atom config.js
// paste in your console
speechSynthesis.onvoiceschanged = function() {
var msg = new SpeechSynthesisUtterance();
msg.voice = this.getVoices().filter(v => v.name == 'Cellos')[0];
msg.text = Object.keys(window).join(' ');
this.speak(msg);
};
@thomaspark
thomaspark / bobross.css
Last active March 9, 2020 14:33
Bob Ross’ color palette in CSS
.sap-green {
background-color: #0A3410;
}
.sap-green-text {
color: #0A3410;
}
.sap-green-border {
border-color: #0A3410;
}
anonymous
anonymous / fizzbuzz.c
Created October 10, 2015 12:50
A FizzBuzz program. Somehow. I don't know why it works.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <gmp.h>
char * polynomial="-74101463560860539810482394216134472786413399/404009590666424903383979388988167534591844018460526499864038804741201731572423877094984692537474105135297393596654648304117684895744000000000000000000000*x^99 + 1786563401621773217421750502452955853226339781/1943688752347061390850759947022111850270039951356484879070977067483444756705819339975871373032521468004867185688372878439054154137600000000000000000000*x^98 - 27321291157050372775340569532625689973429185264741/12024094960310264981666053243695462339042976739896622019763059664916718201560234437350734896948634081407660523709959770955883479040000000000000000000000*x^97 + 4936870031754926645682423836151042176171669450909/1336493173680525187613977630110369004256312194947800263402124063124652591386915768177479078216982141485276408003996973457735680000000000000000000000*x^96 - 24473118674386691114350902920738421254018653211816783/55093218603941649400531744530105211175454647
@yoshikischmitz
yoshikischmitz / fizzbuzz_without_conditionals.rb
Last active August 29, 2015 14:16
A highly extensible, declarative fizzbuzz with no hardcoded if statements, and no mutation.
applicators = {3 => "fizz", 5 => "buzz"}
fizzbuzz =
(1..100).map do |n|
fb = applicators.
select{|a| n % a == 0}.
values.join
[n.to_s, fb].max # "1" > "" and "fizz" > "100000" since "1" < "a"
end
puts fizzbuzz
@mikelove
mikelove / redcarpetkramdown.md
Last active July 5, 2018 06:46
redcarpet vs kramdown play nice with mathjax

Issues with latex math in markdown files, for display on Github Pages (using jekyll)

Our solution: use kramdown parser, with GFM option (Github flavored Markdown). In the .Rmd, use $$ for display math and $ for inline math. then have a script which turns the inline math demarkation in the .md file from $ into $$ when appropriate (avoiding data frame usage), before uploading the .md to Github. This way, RStudio preview looks the same as the Github Pages version.

redcarpet math

  • doesn't respect $ or $$ (will parse characters within these, such as _), but has workarounds:
  • has a useful option, no_intra_emphasis, so underscores between ascii characters are not converted to <em> tags, so $x_1$ is fine
  • need to escape underscores after non-ascii characters, for example $\mathbf{x}\_1$
  • need to double escape curly bracket: \\{
@jac1013
jac1013 / donut_chart.js
Last active November 13, 2020 23:23
A d3.js single value donut chart. JSFiddle: http://jsfiddle.net/8moez4j3/
var donutChart;
(function() {
var width = 500,
height = 300,
radius = 100,
innerRadius = 80,
transitionsDuration = 1000,
transitionsDelay = 250,
percentageTextSize = '2.0rem',
transitionType = 'elastic';
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule