Skip to content

Instantly share code, notes, and snippets.

View nghyane's full-sized avatar

Hoàng Văn Anh Nghĩa nghyane

View GitHub Profile
@py7hon
py7hon / Read.md
Last active August 1, 2023 11:23
Free Image Proxy List

Free Image Proxy List

  1. Google Translate
  • Usage: https://domain-com.translate.goog/image.jpg
  • Example: https://cdn-discordapp-com.translate.goog/attachments/932997963981140069/937172504819138560/unknown.png
  1. DuckDuckGo
  • Usage: https://proxy.duckduckgo.com/iu/?u=url image
  • Example: https://proxy.duckduckgo.com/iu/?u=https://cdn.discordapp.com/attachments/932997963981140069/937172504819138560/unknown.png
import { build, files, version } from '$service-worker';
// https://github.com/microsoft/TypeScript/issues/11781 - this is needed for TS and ESLint
/// env serviceworker
const globalThis = /** @type {unknown} */ (self);
/// <reference no-default-lib="true"/>
/// <reference lib="es2020" />
/// <reference lib="WebWorker" />
const sw = /** @type {ServiceWorkerGlobalScope & typeof globalThis} */ (globalThis);
@shhommychon
shhommychon / Download-FMA-Dataset-with-expensive-Colab-Pro-and-Google-One-2TB.ipynb
Last active August 4, 2022 06:52
Download BIG files to Colab and upload to Google Drive FS
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DenesKellner
DenesKellner / argumentParser.php
Last active February 21, 2023 22:03
Command line argument parser. Very convenient, you can define your switches & parameters as if you were writing the help of your program. Handles string, integer and boolean types, supports numbered arguments (not counting the switches of course), and the same function can be used for declaration and parameter querying. No dependencies.
<?php
function arg($x="",$default=null) {
static $argtext = "";
static $arginfo = [];
/* helper */ $contains = function($h,$n) {return (false!==strpos($h,$n));};
/* helper */ $valuesOf = function($s) {return explode(",",$s);};
@chenset
chenset / Proxy image with nginx
Last active August 14, 2022 05:24
Proxy image with nginx
server {
listen 80;
server_name domain.com;
merge_slashes off;
location ~ /(?<r>http://.*) {
resolver 8.8.4.4 8.8.8.8 4.2.2.2 valid=3600s ipv6=off;
proxy_set_header Referer "";
proxy_pass $r;
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# 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
@vladimirtsyupko
vladimirtsyupko / gist:10964772
Created April 17, 2014 08:32
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
@kmpzr
kmpzr / Redis.php
Created February 15, 2013 13:50
Redis Client (Predis). Keys that Expires.
<?php
class Redis {
private static $handler = NULL;
private static function getHandler()
{
if (self::$handler)
return self::$handler;
@klederson
klederson / HTML5StorageMultidimensional.js
Created October 8, 2012 18:23
Adding Multidimensional Support for javascript / html5 sessionStorage , localStorage or just Storage object
/**
*
* MOVED TO: https://github.com/iFind/html5MultidimensionalStorage
*
* This methods extends the default HTML5 Storage object and add support
* to set and get multidimensional data
*
* @example Storage.setObj('users.albums.sexPistols',"blah");
* @example Storage.setObj('users.albums.sexPistols',{ sid : "My Way", nancy : "Bitch" });
* @example Storage.setObj('users.albums.sexPistols.sid',"Other songs");