Skip to content

Instantly share code, notes, and snippets.

# HG changeset patch
# User Dmitry Volyntsev <xeioex@nginx.com>
# Date 1714094993 25200
# Thu Apr 25 18:29:53 2024 -0700
# Node ID 99b1ca45f022879a13f18273ff108b145af4a87d
# Parent 83dc664adf0f6f101030fa50937c04d924b91103
Fetch: fixed request Host header when port is non standard.
This fixes #707 issue on Github.
@justiceamoh
justiceamoh / colormaps.py
Created October 16, 2015 07:13
New Python Colormaps Including MATLAB Parula
# New matplotlib colormaps by Nathaniel J. Smith, Stefan van der Walt,
# and (in the case of viridis) Eric Firing.
#
# This file and the colormaps in it are released under the CC0 license /
# public domain dedication. We would appreciate credit if you use or
# redistribute these colormaps, but do not impose any legal restrictions.
#
# To the extent possible under law, the persons who associated CC0 with
# mpl-colormaps have waived all copyright and related or neighboring rights
# to mpl-colormaps.
@capJavert
capJavert / rpg.owl
Last active April 26, 2024 02:23
Simple Dungeon & Dragons ontology
<?xml version="1.0"?>
<rdf:RDF xmlns="http://www.semanticweb.org/javert/ontologies/2017/10/dungeons-and-dragons#"
xml:base="http://www.semanticweb.org/javert/ontologies/2017/10/dungeons-and-dragons"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<owl:Ontology rdf:about="http://www.semanticweb.org/javert/ontologies/2017/10/dungeons-and-dragons"/>
@ryanorsinger
ryanorsinger / installing_anaconda_on_mac.md
Last active April 26, 2024 02:22
Installing Homebrew and Anaconda

Installing Homebrew and Anaconda on a Mac

Install Homebrew

Run the following command on your terminal to install Homebrew. Homebrew is a package manager for Macs and is used to install useful development tools and software.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install Anaconda through Homebrew

  1. Run brew install --cask anaconda to install Anaconda
import Foundation
extension UIDevice {
/**
Try to get the username from the device name using common knows
default device names format.
- copyright: Owen Godfrey on [StackOverflow](http://stackoverflow.com/questions/8261961/better-way-to-get-the-users-name-from-device)
- remark: Original regexpr improved to support custom name with model included eg. `<username>'s iPhone 6S`
@GhibliField
GhibliField / 计算机类学术论文 28个常见出版社一般写法.md
Last active April 26, 2024 02:19
计算机类学术论文 28个常见出版社一般写法(参考文献用)
序号 出版社一般写法 出版地 备注
1 AAAI Menlo Park, CA Association for the Advancement of Artificial Intelligence
2 Academic 同Elsevier Academic Press is part of Elsevier
3 Academy Press New York/ London/ Paris/ San Diedo,CA/ San Francisco,CA/ Sao Paulo/ Sydney/ Tokyo/Toronto AP,Academy Press
4 ACL Stroudsburg,PA Association for Computational Linguistics
5 ACM New York, NY ACM Press,Association for Computing and Machinery
6 AP Professional Boston,MA/ San Diedo,CA/New York/ London/ Sydney/ Tokyo/ Toronto  
7 Chapman & Hall London/ Glasgow/ Weinheim/ New York/ Madras CH
@A1vinSmith
A1vinSmith / Privilege Escalation.md
Last active April 26, 2024 02:16
Privilege Escalation: Systemctl (Misconfigured Permissions — sudo/SUID)
function getPageTotal(offset = 0) {
req = new XMLHttpRequest();
req.open(
'GET',
`https://shopee.vn/api/v4/order/get_all_order_and_checkout_list?limit=20&offset=${offset}`,
false
);
req.send();
a = JSON.parse(req.responseText);
if (a.data.next_offset === -1) return 0;
@katagaki
katagaki / EncodedPolylines.swift
Created April 22, 2023 09:12
Swift implementation of the Encoded Polyline Algorithm Format by Google.
// Encoded polyline algorithm from https://developers.google.com/maps/documentation/utilities/polylinealgorithm
func encode(_ original: Double) -> String {
var point = UInt32(abs(Int((original * 100000).rounded())))
if original < 0 {
point = ~point + 1
}
point <<= 1
if original < 0 {
point = ~point
}
@vukcevich
vukcevich / endian-conversion-cheat-sheet.swift
Created December 21, 2016 21:33 — forked from DevAndArtist/endian-conversion-cheat-sheet.swift
A cheat sheet for byte conversion of number types in Swift 3.0
func _convertToBytes<T>(_ value: T, withCapacity capacity: Int) -> [UInt8] {
var mutableValue = value
return withUnsafePointer(to: &mutableValue) {
return $0.withMemoryRebound(to: UInt8.self, capacity: capacity) {
return Array(UnsafeBufferPointer(start: $0, count: capacity))
}
}