Skip to content

Instantly share code, notes, and snippets.

View fukuball's full-sized avatar

Fukuball Lin fukuball

View GitHub Profile
@fukuball
fukuball / AllowedMarketplacesNFT.sol
Created January 13, 2023 04:39 — forked from shobhitic/AllowedMarketplacesNFT.sol
Block/Censor NFT marketplaces that don't honour royalties - https://www.youtube.com/watch?v=pdvnUMz1U8o
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts@4.7.3/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts@4.7.3/access/Ownable.sol";
import "@openzeppelin/contracts@4.7.3/utils/Counters.sol";
contract MyToken is ERC721, Ownable {
using Counters for Counters.Counter;
@fukuball
fukuball / app.js
Created December 20, 2022 09:01 — forked from kevinbubu/app.js
ChatGPT - LINE Chatbot
const express = require('express');
const line = require('@line/bot-sdk');
const request = require('request');
const CHANNEL_ACCESS_TOKEN = 'YOUR_CHANNEL_ACCESS_TOKEN';
const CHANNEL_SECRET = 'YOUR_CHANNEL_SECRET';
const OPENAI_API_KEY = 'YOUR_OPENAI_API_KEY';
// 建立 LINE Bot 物件
const config = {
@fukuball
fukuball / encoding-video.md
Created June 17, 2018 09:32 — forked from Vestride/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@fukuball
fukuball / PushNotifications.php
Created September 30, 2017 09:11 — forked from joashp/PushNotifications.php
Simple PHP script to send Android Push Notification, iOS Push Notification and Windows Phone 8 Push Notification
<?php
// Server file
class PushNotifications {
// (Android)API access key from Google API's Console.
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI';
// (iOS) Private key's passphrase.
private static $passphrase = 'joashp';
// (Windows Phone 8) The name of our push channel.
private static $channelName = "joashp";
@fukuball
fukuball / mydft.py
Created June 6, 2017 15:43 — forked from dannvix/mydft.py
Intuitive impementation of discrete Fourier transform (and inverse DFT) in Python (without numpy)
#!/usr/bin/env python3
import math
# >> Discrete Fourier transform for sampled signals
# x [in]: sampled signals, a list of magnitudes (real numbers)
# yr [out]: real parts of the sinusoids
# yi [out]: imaginary parts of the sinusoids
def dft(x):
N, yr, yi = len(x), [], []
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fukuball
fukuball / pdftitle.py
Created April 28, 2017 17:46 — forked from hanjianwei/pdftitle.py
Extract title from pdf file.
#!/usr/bin/env python
"""
Extract title from PDF file.
Depends on: pyPDF, PDFMiner.
Usage:
find . -name "*.pdf" | xargs -I{} pdftitle -d tmp --rename {}
// Run from the dev tools console of any Youtube video
// Accurate as of October 28, 2016. Uses quality + video type for naming now,
// prevents video urls being overwritten.
// ES6 version
const videoUrls = ytplayer.config.args.url_encoded_fmt_stream_map
.split(',')
.map(item => item
.split('&')
.reduce((prev, curr) => (curr = curr.split('='),
@fukuball
fukuball / EmailController.php
Created March 9, 2017 06:18 — forked from agarwa13/EmailController.php
Laravel 5.1 Controller that receives AWS SES Bounce and Complaint notifications sent via AWS SNS. It records the email addresses that bounced or complained in a database.
<?php
public function postBounceOrComplaint(Request $request, Mailer $mailer){
Log::info($request->json()->all());
if($request->json('Type') == 'SubscriptionConfirmation'){
$client = new Client();
$client->get($request->json('SubscribeURL'));
return response()->json();
@fukuball
fukuball / _Stay_standalone.md
Created January 4, 2017 07:10 — forked from irae/_Stay_standalone.md
Stay Standalone: Prevent links in standalone web apps opening Mobile Safari

#Stay Standalone

A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.