Skip to content

Instantly share code, notes, and snippets.

View d1y's full-sized avatar
💤

d1y

💤
  • 13:42 (UTC +08:00)
View GitHub Profile
@d1y
d1y / readme.md
Created April 9, 2019 03:46 — forked from jimmywarting/readme.md
Cors proxies
Server SSL Metods Server country code Comments
[cors-anywhere][1] - US Follows redirects 5x
Require Origin header
[crossorigin.me][2] GET US Require Origin header
2MB size limit
[cors-proxy.htmldriven][3] - CZ JSON response
don't work well with binary
[cors-proxy.taskcluster][4] POST US Only witelisted to taskcluster.net
Can send any header/method
[jsonp.herokuapp.com][5] - US Supports both jsonp and cors
[anyorigin][8] - US Only jsonp is supported, response is always json, always require a refferer header
[thingproxy][9] ANY US Limited to 100kb for both upload and download, max 10 req/sec
[whateverorigin][10] GET US Only supports
import discord
from discord.ext import commands
from __main__ import send_cmd_help
import aiohttp
from bs4 import BeautifulSoup
import random
from .utils import checks
from cogs.utils.dataIO import dataIO
import os
@d1y
d1y / source.json
Created August 8, 2019 08:53 — forked from ZyqGitHub1/source.json
hls-source
[
{
"id": 1,
"name": "色色资源站",
"uri": "https://www.emiao026.com",
"httpApi": "http://sscj8.com/inc/api.php",
"httpsApi": "http://sscj8.com/inc/sapi.php",
"type": "综合性资源"
},
{
@d1y
d1y / install-gcc48-linuxbrew-centos6.md
Created November 6, 2019 13:09 — forked from stephenturner/install-gcc48-linuxbrew-centos6.md
Installing gcc 4.8 and Linuxbrew on CentOS 6

Installing gcc 4.8 and Linuxbrew on CentOS 6

The GCC distributed with CentOS 6 is 4.4.7, which is pretty outdated. I'd like to use gcc 4.8+. Also, when trying to install Linuxbrew you run into a dependency loop where Homebrew's gcc depends on zlib, which depends on gcc. Here's how I solved the problem.

Note: Requires sudo privileges.

Resources:

@d1y
d1y / install_dbus.sh
Created January 1, 2020 02:57 — forked from berkin/install_dbus.sh
Install DBus under Mac OS X.
#!/usr/bin/env bash
# Created @ 13.01.2015 by Christian Mayer <http://fox21.at>
brew install dbus
cp /usr/local/Cellar/d-bus/1.8.8/org.freedesktop.dbus-session.plist ~/Library/LaunchAgents
# Load DBus
launchctl load -w ~/Library/LaunchAgents/org.freedesktop.dbus-session.plist
@d1y
d1y / workingDir.go
Created March 30, 2020 03:57 — forked from arxdsilva/working_directory.go
How to get the current working directory in golang
package main
// More info on Getwd()
// https://golang.org/src/os/getwd.go
//
import(
"os"
"fmt"
"log"
)
@d1y
d1y / .bashrc
Created March 30, 2020 05:45 — forked from vsouza/.bashrc
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@d1y
d1y / command_exists.go
Created April 7, 2020 07:07 — forked from miguelmota/command_exists.go
Golang check if command exists
package main
import (
"log"
"os/exec"
)
func main() {
path, err := exec.LookPath("ls")
if err != nil {
@d1y
d1y / go-build-all
Created April 12, 2020 05:52 — forked from eduncan911/go-build-all
Go Cross-Compile Script
#!/bin/bash
#
# GoLang cross-compile snippet for Go 1.6+ based loosely on Dave Chaney's cross-compile script:
# http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go
#
# To use:
#
# $ cd ~/path-to/my-awesome-project
# $ go-build-all
#
@d1y
d1y / confirm.go
Created August 7, 2020 16:12 — forked from r0l1/confirm.go
Go (golang): How to ask for user confirmation via command line
/* MIT License
*
* Copyright (c) 2017 Roland Singer [[email protected]]
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions: