Skip to content

Instantly share code, notes, and snippets.

View sr229's full-sized avatar
:octocat:
GitHubは私の街です。 (๑・ω・๑)

Ayase Minori sr229

:octocat:
GitHubは私の街です。 (๑・ω・๑)
View GitHub Profile
char_to_hex = function(c)
return string.format("%%%02X", string.byte(c))
end
function urlencode(url)
if url == nil then
return
end
url = url:gsub("\n", "\r\n")
url = url:gsub("([^%w ])", char_to_hex)
@sr229
sr229 / che-electron.sh
Created April 3, 2017 04:22
Script to open Eclipse Che electron app, together with the server (as docker image)
#!/bin/sh
# check if docker is working
docker ps &> /dev/null
if [ $? -ne 0 ]; then
echo "[ERROR]\tCannot connect to the Docker daemon. Is the docker daemon running on this host?" 1>&2
return 1
fi
CONTAINER="che"
@sr229
sr229 / Github Webhook Tutorial.md
Created November 26, 2016 12:58 — forked from jagrosh/Github Webhook Tutorial.md
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@sr229
sr229 / quark_music.js
Created August 2, 2016 05:30
full music bot written in eris. at this moment it only supports playing in one guild at a time, but this can be fixed very easily.
'use strict';
const Eris = require("eris");
const ytdl = require('ytdl-core');
var bot = new Eris.CommandClient("token", {}, {
description: "The Quantum MusicBot.",
owner: "Gus",
prefix: "q!"
});