This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
import math | |
import numpy as np | |
import tensorflow as tf | |
from PIL import Image | |
net_model = tf.keras.models.load_model('NIvsCG_sgd_lr-1e-5_WITH_REDUCE-LR.28-0.29.h5') | |
## images here | |
images = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// npm install --save recast babylon@next @types/node | |
import * as recast from "recast"; | |
import * as typescriptParser from "recast/parsers/typescript"; | |
import * as fs from "fs"; | |
export interface IMyTable { | |
id: number; | |
title: string; | |
createdAt: Date; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (props) => ( | |
<input | |
onKeyDown={(event) => { | |
const { keyCode } = event; | |
if ( | |
(keyCode >= 8 && keyCode <= 9) || //BACKSPACE and TAB | |
(keyCode >= 37 && keyCode <= 40) || // Arrows | |
keyCode === 46 || //DEL | |
keyCode === 190 || //DEL | |
(keyCode >= 48 && keyCode <= 57) || // Numbers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Pinch and Zoom + Panning + Rotation</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" /> | |
<style> | |
html,body { | |
overscroll-behavior-x: none; | |
overscroll-behavior-y: none; | |
touch-action: none; | |
height: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set url "http://www.cardenas-grancanaria.com/search-results.asp?FirstRecord=1&txtRC=R&txtOperacion=1&txtLocation=&txtPropType=1%2C2%2C3%2C4%2C+5%2C6%2C7%2C8%2C9%2C+19%2C20&txtBeds=&txtMinPrice=0&txtMaxPrice=&txtPool=&txtParking=&txtNewDev=&txtSeaView=&txtLux=False&txtI=False&txtSF=False&txtRF=False&pagesize=300&price_order=DESC" | |
curl $url | rg -o 'href\s*="([^"]+for-sale[^"]+)"' | sd '(^href="|"$)' '' | uniq > properties | |
xargs -n 1 curl -O < properties | |
rg -oe '(Type|Location|Bedrooms|Bathrooms|Build Size|Living Area|Price) : </b></td><td>(.*?)</td>' | sd "<[^<]*>" "" | sd " : " ":" | node -e 'console.log("ID;Type;Location;Bedrooms;Bathrooms;Build Siz;Living Area;Price") || console.log(Object.values(fs.readFileSync("/dev/stdin").toString().split("\\n").filter(Boolean).map(a => a.split(":")).reduce((acc, [id, type, val]) => ({ ...acc, [id]: { ...(acc[id] || {}), Id: id.replace(".htm", ""), [type]: val.trim().replace(/\\s+/g, " ") } }) , {})).filter(({ Price }) => Number(Price.split(" ")[0].replace(/\\./,""))).s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo ip link set down dev wlp3s0 && sudo ip link set dev wlp3s0 address $(tr -dc A-F0-9 < /dev/urandom | head -c 10 | sed -r 's/(..)/\1:/g;s/:$//;s/^/02:/') && sudo ip link set up dev wlp3s0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs> {}; # bring all of Nixpkgs into scope | |
perl530Packages.buildPerlPackage rec { | |
pname = "Percona-Toolkit305"; | |
version = "3.0.5"; | |
src = fetchurl { | |
# url = "https://www.percona.com/downloads/percona-toolkit/3.0.4/source/tarball/percona-toolkit-3.0.4.tar.gz"; | |
# sha256 = "fa3e34bdcb272edf95a5e9e4a14c9d111e35427eca3232a37fe7c1632ed3b43f"; | |
url = "https://www.percona.com/downloads/percona-toolkit/3.0.5/source/tarball/percona-toolkit-3.0.5.tar.gz"; | |
sha256 = "6ca8dd50fcff8a6030026201a5224bd3446d66c2c2ce484dc5c4cfae359c955b"; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async () => { | |
const salt = window.crypto.getRandomValues(new Uint8Array(16)) | |
const password = 'lol' | |
const notPassword = 'cat' | |
const importedKey = await window.crypto.subtle.importKey( | |
'raw', | |
new TextEncoder().encode(password), | |
{ name: 'PBKDF2' }, | |
!Boolean('extractable'), | |
['deriveKey'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$$('textarea').map(textarea => textarea.addEventListener('drop', (e) => { | |
let reader = new FileReader() | |
reader.readAsDataURL(e.dataTransfer.files[0]) | |
reader.onloadend = () => { | |
console.log(reader.result) | |
const [type, data] = reader.result.split(',') | |
e.target.innerHTML = atob(data) | |
} | |
e.preventDefault() | |
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
//Federico Rampazzo, 2011, https://pastebin.com/EpYUjYgb | |
bool checkV(char * C, int m, int n, char * P, int lung, int posM, int posN){ | |
cout << "Looking for vertical match in " << posN << "-" << posN+lung-1 << "..\n"; | |
for (int j=posN; j<posN+lung; j++){ | |
int startM = posM-(j-posN); cout << "Starting from " << startM << "x" << j << "\n"; | |
int c = 0; | |
if (startM>=0 && startM+lung<=m) |