This file contains 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 ( | |
"encoding/json" | |
"encoding/xml" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"net/url" | |
) |
This file contains 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 | |
#LICENSE | |
#To the extent possible under law, the author(s) have dedicated all | |
#copyright and related and neighboring rights to this software to the | |
#public domain worldwide. This software is distributed without any warranty. | |
#See <http://creativecommons.org/publicdomain/zero/1.0/>. | |
# ffcapture, a hacky script to stream/capture your desktop or a window | |
# REQUIRES ffmpeg, xwininfo and bc to be installed! |
This file contains 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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
This file contains 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
function getTimeZoneString() { | |
var abbr = ""; | |
try { | |
abbr = new Intl.DateTimeFormat().resolvedOptions().timeZone; | |
} catch (e) { | |
abbr = "" | |
} | |
return abbr || ""; |
This file contains 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 /etc/init.d/apache2 stop |
This file contains 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 node:10-alpine | |
RUN apk update && \ | |
apk add --update --repository http://dl-3.alpinelinux.org/alpine/edge/community vips-tools vips-dev fftw-dev gcc g++ make libc6-compat && \ | |
apk add git && \ | |
apk add python && \ | |
rm -rf /var/cache/apk/* | |
#RUN git config --global url."https://github.com/".insteadOf "[email protected]:" | |
RUN git config --global user.email "[email protected]" |
This file contains 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
<?php | |
namespace Firebase\JWT; | |
use \DomainException; | |
use \InvalidArgumentException; | |
use \UnexpectedValueException; | |
use \DateTime; | |
/** | |
* JSON Web Token implementation, based on this spec: |
This file contains 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
docker run -it --rm -u $(id -u ${USER}):$(id -g ${USER}) -v ${PWD}:/app node:11 /bin/sh |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>JS in-browser barcode reader</title> | |
<style type="text/css"> | |
body > div { | |
position: relative; | |
width: 320px; height: 240px; | |
} | |
video { position: absolute; top: 0; left: 0; width: 320px; height: 240px; } |
This file contains 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
<?php | |
define('SLACK_WEBHOOK', 'https://hooks.slack.com/services/xxx/yyy/zzz'); | |
function slack($txt) { | |
$msg = array('text' => $txt); | |
$c = curl_init(SLACK_WEBHOOK); | |
curl_setopt($c, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false); | |
curl_setopt($c, CURLOPT_POST, true); | |
curl_setopt($c, CURLOPT_POSTFIELDS, array('payload' => json_encode($msg))); | |
curl_exec($c); |
NewerOlder