Skip to content

Instantly share code, notes, and snippets.

View FuckStickFunFuck's full-sized avatar
:electron:
#MotionlessInWhite #EmaculateMisconception

LilPimpn86 FuckStickFunFuck

:electron:
#MotionlessInWhite #EmaculateMisconception
View GitHub Profile
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008
Compiled by Eric Pement - eric [at] pement.org version 0.27
Latest version of this file (in English) is usually at:
http://www.pement.org/awk/awk1line.txt
This file will also be available in other languages:
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt
USAGE:
@FuckStickFunFuck
FuckStickFunFuck / main.dart
Created June 12, 2023 19:21
powerful-flash-9865
void main() {
for (int i = 0; i < 5; i++) {
print('hello ${i + 1}');
}
}

Regex: Matching a URL

Regex is a helpful tool used for text processing tasks such as searching, replacing, and extracting information from text. It consists of a sequence of characters and special characters that define a search pattern, which can match specific patterns in text. Regular expressions are widely used in programming languages and tools and can greatly simplify complex tasks that would otherwise require great manual effort. Imagine trying to extract every istance of a URL from a 100 page document, and having to "Command-F" each individual URL- sounds terrible and very time consuming, right? Well that's why regexes are here to make your life easier.

Summary

One of the common applications of regex is to match for URLs. URLs have a specific format that can be easily identified using regular expressions. A regular expression for matching URLs typically includes the protocol, domain name, and optionally a path or query parameters. By using regex to match URLs, you can easily extract informati

@pwnall
pwnall / code.js
Last active April 9, 2023 08:04
DOM manipulation and Fetch API
async function asyncSleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function onSearchClick(event) {
event.preventDefault();
const cityNameInput = document.getElementById('city-name');
const cityName = cityNameInput.value;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tsbertalan
tsbertalan / custom_gradient_polynomial.py
Last active August 26, 2021 17:38
Demonstrate tensorflow's `custom_gradient` for a polynomial op.
import tensorflow as tf, numpy as np, matplotlib.pyplot as plt
trainable = []
order = 4
@tf.custom_gradient
def poly(x):
# Create the (or get a handle to the existing existing) polynomial coefficients variable
# that we're supposed to learn.
@pwnall
pwnall / get_layout_test_fonts.sh
Last active April 9, 2025 14:50
Get the fonts needed by Chromium's LayoutTests on Fedora Linux
sudo mkdir -p /usr/share/fonts/opentype
sudo mkdir -p /usr/share/fonts/truetype
sudo dnf install -y ipa-gothic-fonts ipa-pgothic-fonts ipa-mincho-fonts ipa-pmincho-fonts
sudo mkdir -p /usr/share/fonts/opentype/ipafont-gothic
sudo cp /usr/share/fonts/ipa-gothic/ipag.ttf /usr/share/fonts/opentype/ipafont-gothic/
sudo cp /usr/share/fonts/ipa-pgothic/ipagp.ttf /usr/share/fonts/opentype/ipafont-gothic/
sudo mkdir -p /usr/share/fonts/opentype/ipafont-mincho
sudo cp /usr/share/fonts/ipa-mincho/ipam.ttf /usr/share/fonts/opentype/ipafont-mincho/
sudo cp /usr/share/fonts/ipa-pmincho/ipamp.ttf /usr/share/fonts/opentype/ipafont-mincho/
@ssstonebraker
ssstonebraker / sed cheatsheet
Created August 2, 2013 14:06 — forked from un33k/sed cheatsheet
Sed Cheatsheet
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
search = [ notebook , separator ] ,
[ "any:" , separator ] ,
term ,
{ separator , term } ;
notebook = "notebook:" , ( word | quoted ) ;
word = wordchar , { wordchar } ;
quoted = '"' , { ( any - '"' ) | '\"' } , '"' ;
@Rafe
Rafe / gist:3102414
Created July 13, 2012 02:59
AWK cheatsheet
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008
Compiled by Eric Pement - eric [at] pement.org version 0.27
Latest version of this file (in English) is usually at:
http://www.pement.org/awk/awk1line.txt
This file will also be available in other languages:
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt
USAGE: