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
<!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); |
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 | |
/** | |
* Send a Message to a Slack Channel. | |
* | |
* In order to get the API Token visit: https://api.slack.com/custom-integrations/legacy-tokens | |
* The token will look something like this `xoxo-2100000415-0000000000-0000000000-ab1ab1`. | |
* | |
* @param string $message The message to post into a channel. | |
* @param string $channel The name of the channel prefixed with #, example #foobar |
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
<IfModule mod_rewrite.c> | |
Options -MultiViews | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^(.*)$ index.php [QSA,L] | |
</IfModule> | |
<IfModule !mod_rewrite.c> | |
<IfModule mod_alias.c> | |
RedirectMatch 302 ^/$ /index.php/ |
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 | |
require 'vendor/autoload.php'; | |
use Guzzle\Service\Client; | |
// Create a client with a base URL | |
$client = new Client('http://requestb.in/1ivmkhd1'); | |
$client->setUserAgent('myuseragent'); | |
// Send a request to https://github.com/notifications | |
$response = $client->get('')->send(); |
NewerOlder