Language | Package Manager | CLI | Manifest file | Lock file |
---|---|---|---|---|
Ruby | Bundler | bundle | Gemfile | Gemfile.lock |
JavaScript | npm | npm | package.json | package-lock.json |
Yarn | yarn | package.json | yarn.lock | |
Swift | Swift Package Manager | swift package | Package.swift | Package.resolved |
CocoaPods | pod | Podfile | Podfile.lock |
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
import * as repl from 'repl'; | |
function myEval(cmd, context, filename, callback) { | |
callback(null, cmd.trim()); | |
} | |
function myWriter(output) { | |
return output; | |
} |
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
(define (fizzbuzz) | |
(define (fizzbuzz-iter counter max-count) | |
(print counter) | |
(if (>= counter max-count) | |
'done | |
(fizzbuzz-iter (+ counter 1) max-count))) | |
(define (print n) | |
(cond ((and (divisible n 3) (divisible n 5)) (write-line 'fizzbuzz)) | |
((divisible n 3) (write-line 'fizz)) | |
((divisible n 5) (write-line 'buzz)) |
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
(define (square x) (* x x)) | |
(define (sum-of-squares x y) | |
(+ (square x) (square y))) | |
(define (max x y) | |
(if (> x y) x y)) | |
(define (min x y) | |
(if (< x y) x y)) |
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
def graduated_price(users) | |
if users <= 3 | |
return 0 | |
elsif users <= 10 | |
return graduated_price(3) + 5 * (users - 3) + 15 | |
elsif users <= 14 | |
return graduated_price(10) | |
elsif users <= 17 | |
return graduated_price(14) + 25 | |
elsif users <= 24 |
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 lessonList = [...] | |
const timeslotRange = [...] | |
const roomRange = [...] | |
const timeTable = new TimeTable() | |
const timeLimit = 5000 | |
const startTime = new Date() | |
let currentTime = startTime | |
let bestScore = 0 |
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
activity(friday, 'september townhall'). | |
activity(saturday, 'learn prolog facts'). | |
activity(sunday, 'learn prolog rules'). | |
weekend(saturday). | |
weekend(sunday). | |
weekend_activity(A) :- | |
activity(D, A), | |
weekend(D). |
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
def deriv(f) | |
dx = 0.000001 | |
->(x) { (f.(x+dx) - f.(x)) / dx } | |
end | |
f = ->(x) { x*x + 2*x + 1 } | |
g = deriv(f) | |
g.(2) | |
# => 6.000001000927568 |
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 elasticsearch import Elasticsearch | |
import re | |
import subprocess | |
import time | |
def build_doc(): | |
doc = {} | |
doc.update(current_batt()) | |
doc.update(current_time()) |
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 elasticsearch import Elasticsearch | |
import time | |
THERMAL_ZONES = [ | |
"/sys/class/thermal/thermal_zone0", | |
"/sys/class/thermal/thermal_zone1", | |
"/sys/class/thermal/thermal_zone2", | |
] | |