Skip to content

Instantly share code, notes, and snippets.

View fukuball's full-sized avatar

Fukuball Lin fukuball

View GitHub Profile
@shobhitic
shobhitic / AllowedMarketplacesNFT.sol
Last active January 13, 2023 04:39
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;
@dannvix
dannvix / mydft.py
Last active April 21, 2023 16:19
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), [], []
let webpack = require('webpack');
let path = require('path');
module.exports = {
entry: {
app: './resources/assets/js/app.js',
vendor: ['vue', 'axios']
},
output: {
@Jpoliachik
Jpoliachik / AppDelegate.m
Created December 19, 2016 15:25
ReactNative iOS Launch Screen No Flash
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// 1. init window
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
// 2. backgroundView using LaunchScreen.xib
UIView *backgroundView = [[[NSBundle mainBundle] loadNibNamed:@"LaunchScreen" owner:self options:nil] firstObject];
backgroundView.frame = self.window.bounds;
@geuis
geuis / gist:8b1b2ea57d7f9a9ae22f80d4fbf5b97f
Last active January 10, 2024 16:43
Get Youtube video urls
// Run from the dev tools console of any Youtube video
// Accurate as of July 2, 2020.
//
// Copy and paste this into the dev console in a browser with the desired video loaded.
//
// NOTE: Some Youtube videos do not directly expose the video url in the response.
// This script doesn't currently attempt to handle those. It will work for most other general video types though.
(async () => {
const html = await fetch(window.location.href).then((resp) => resp.text()).then((text) => text);
@Mistobaan
Mistobaan / tensorflow_cuda_osx.md
Last active July 25, 2023 18:54
How to enable cuda support for tensor flow on Mac OS X (Updated on April:2016 Tensorflow 0.8)

These instructions will explain how to install tensorflow on mac with cuda enabled GPU suport. I assume you know what tensorflow is and why you would want to have a deep learning framework running on your computer.

Prerequisites

Make sure to update your homebrew formulas

brew update
@hlb
hlb / Brewfile
Last active June 14, 2022 02:48 — forked from saetia/gist:1623487
Clean Install Script
cask_args appdir: '/Applications'
tap 'caskroom/cask'
tap "homebrew/cask-fonts"
tap 'caskroom/versions'
tap "homebrew/bundle"
tap "homebrew/core"
tap "homebrew/services"
tap "hsatac/toybox"
brew "coreutils"
brew "gnu-sed"
@ufologist
ufologist / fake-autoplay-audio-ios-safari.html
Created December 3, 2015 06:16
Fake auto play html audio in iOS Safari the right way
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>Fake auto play html audio in iOS Safari the right way</title>
</head>
<body>
<h1>在 iOS Safari 中假装自动播放 HTML5 audio(音乐) 的正确方式</h1>
<p>核心原理: 通过一个用户交互事件来主动 play 一下 audio</p>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@agarwa13
agarwa13 / EmailController.php
Created November 5, 2015 02:26
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();