This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| type spinner struct { | |
| chars []string | |
| current int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require("fs"); | |
| const path = require("path"); | |
| const cson = require("cson"); | |
| const { folders } = require("./boostnote.json"); | |
| const DIRECTORIES = { | |
| IMPORT: "notes", | |
| EXPORT: "export", | |
| NOTES: "notes", | |
| SNIPPETS: "snippets" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"dark":"1","docs":"apache_http_server/async/babel/bash/bootstrap~4/c/cpp/clojure~1.9/cmake~3.12/crystal/css/d3~5/dart~2/docker~17/dom/dom_events/electron/elixir~1.7/erlang~21/eslint/express/gcc~7/git/go/haskell~8/homebrew/html/http/javascript/jest/jsdoc/koa/kotlin/laravel~5.6/lodash~4/lua~5.3/markdown/moment/mongoose/nginx/nginx_lua_module/node/nokogiri/npm/numpy~1.14/pandas~0.22/perl~5.26/phoenix/php/postgresql~10/pug/puppeteer/python~3.7/qt~5.11/ramda/react/react_native/redis/redux/relay/requirejs/rethinkdb~javascript/rethinkdb~ruby/ruby~2.5/minitest/rails~5.2/rust/sass/socketio/sqlite/svg/terraform/typescript/vue~2/webpack/yarn"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const leftRiemannSum = (f, start, stop, inc) => { | |
| if (start >= stop) return 0; | |
| return f(start) * inc + leftRiemannSum(f, start + inc, stop, inc); | |
| }; | |
| const middleRiemannSum = (f, start, stop, inc) => { | |
| const middle = (start + inc) / 2; | |
| if (start >= stop) return inc * f(middle); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const newHornerSequence = | |
| (...seq) => | |
| x => | |
| seq.slice(0, -1).reduce((acc, n) => (acc + n) * x, 0) + seq.pop(); | |
| console.log(newHornerSequence(4, 5, 6, 7, 8)(5)); // 3318 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://www.newthinktank.com/2012/11/visitor-design-pattern-tutorial/ | |
| // https://www.youtube.com/watch?v=pL4mOUDi54o | |
| interface Visitor { | |
| visitLiquor(liquorItem: Liquor): number; | |
| visitTobacco(tobaccoItem: Tobacco): number; | |
| visitNecessity(necessityItem: Necessity): number; | |
| } | |
| class TaxVisitor implements Visitor { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM joaofnds/rails-alpine as builder | |
| RUN mkdir /app | |
| WORKDIR /app | |
| COPY Gemfile Gemfile.lock /app/ | |
| RUN bundle install | |
| FROM joaofnds/rails-alpine | |
| RUN mkdir /app | |
| WORKDIR /app | |
| COPY --from=builder /usr/local/bundle/ /usr/local/bundle/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ruby:alpine | |
| # Minimal requirements to run a Rails app | |
| RUN apk add --no-cache --update build-base \ | |
| linux-headers \ | |
| git \ | |
| postgresql-dev \ | |
| tzdata \ | |
| nodejs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "database/sql" | |
| "encoding/json" | |
| "fmt" | |
| "log" | |
| _ "github.com/go-sql-driver/mysql" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cmath> | |
| #include <iostream> | |
| #include <queue> | |
| #include <iomanip> | |
| using namespace std; | |
| typedef pair<int, int> coords; | |
| inline double vector__length(coords pos) { |