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
sudo dnf install vips vips-tools vips-devel |
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
func (s *Service) ChunkUpload(ctx context.Context, r *multipart.Reader) error { | |
chunk, err := s.parseChunk(r) | |
if err != nil { | |
return fmt.Errorf("failed parsing chunk %w", err) | |
} | |
// checkpoint | |
select { | |
case <-ctx.Done(): | |
// Abort / return early |
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
export default { | |
subtract(date, days) { | |
return this.add(date, -days); | |
}, | |
add(date, days) { | |
const result = new Date(date); | |
result.setDate(result.getDate() + days); | |
return result; | |
}, | |
addMonths(date, months) { |
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 smq | |
//SMQ is the main controller for the queue. | |
type SMQ struct { | |
jobQueue chan []byte | |
consumer chan Message | |
worker chan int | |
} | |
//New takes in the max queue size and workers. |
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 <Servo.h> | |
Servo myservo; | |
void setup() { | |
Serial.begin(9600); | |
myservo.attach(9); | |
} | |
void loop() { |
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 ( | |
"bytes" | |
"encoding/binary" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"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
const spawnSync = require('child_process').spawnSync; | |
const defaultDestPath = __dirname + '/pdf'; | |
function convertToPdf(filepath, destpath) { | |
var resp = {}; | |
if (destpath == undefined) { | |
destpath = defaultDestPath; | |
} |
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
// openBrowser tries to open the URL in a browser, | |
// and returns whether it succeed in doing so. | |
func openBrowser(url string) bool { | |
var args []string | |
switch runtime.GOOS { | |
case "darwin": | |
args = []string{"open"} | |
case "windows": | |
args = []string{"cmd", "/c", "start"} | |
default: |
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
#!/bin/bash | |
wget https://github.com/Pyppe/phantomjs2.0-ubuntu14.04x64/raw/master/bin/phantomjs | |
sudo chmod 755 phantomjs | |
sudo mv phantomjs /usr/bin |
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
#!/bin/bash | |
sudo apt-get update | |
sudo apt-get install git | |
curl -O https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz | |
tar -xvf go1.6.linux-amd64.tar.gz |
NewerOlder