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 typing import Any, Callable, ParamSpec, Type, TypeVar | |
T = TypeVar('T') | |
P = ParamSpec('P') | |
def singleton(cls: Type[T]) -> Callable[P, T]: | |
""" | |
Example: | |
>>> @singleton | |
... class C: ... |
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
hello world |
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
class Libcpuid < Formula | |
desc "A small C library for x86 CPU detection and feature extraction " | |
homepage "https://github.com/anrieff/libcpuid" | |
head "https://github.com/anrieff/libcpuid.git" | |
depends_on "automake" => :build | |
depends_on "libtool" => :build | |
depends_on "autoconf" => :build | |
def install |
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
autoload -U colors && colors | |
precmd() { | |
red_at="%{$fg[red]}@%{$reset_color%}" | |
red_dollar="%{$fg[red]%}$%{$reset_color%}" | |
typeset host_info | |
[[ -n $SSH_CONNECTION ]] && host_info="$USER${red_at}$HOST " | |
if [[ $USER == "CC" ]]; then | |
# number of chracters of the path of the prompt is less 30 | |
# use '~' to represent $HOME as long as possible |
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
class UniversalBrewedPython < Requirement | |
satisfy { archs_for_command("python").universal? } | |
def message; <<-EOS.undent | |
A build of GDB using a brewed Python was requested, but Python is not | |
a universal build. | |
GDB requires Python to be built as a universal binary or it will fail | |
if attempting to debug a 32-bit binary on a 64-bit host. | |
EOS |
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
class Latexmk < Formula | |
desc "Latexmk completely automates the process of generating a LaTeX document." | |
homepage "http://users.phys.psu.edu/~collins/software/latexmk-jcc/" | |
url "http://users.phys.psu.edu/%7Ecollins/software/latexmk-jcc/latexmk-443a.zip" | |
sha256 "e410d295c0a47327b953ece5b582c294359bdf89138ef990d5621b020ff2bbe5" | |
depends_on :tex | |
depends_on "ghostscript" => :optional | |
def install |
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
class Zlog < Formula | |
homepage "https://hardysimpson.github.io/zlog/" | |
stable do | |
url "https://github.com/HardySimpson/zlog/archive/1.2.12.tar.gz" | |
sha1 "592be9688df1a713e190e2a9664157516cc6724f" | |
end | |
head do | |
url "https://github.com/HardySimpson/zlog.git" |
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
require "formula" | |
class R2 < Formula | |
homepage "http://radare.org" | |
revision 2 | |
head do | |
url "https://github.com/radare/radare2.git" | |
resource "bindings" do |
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
diff -urNad nbtscan-1.5.1~/nbtscan.c nbtscan-1.5.1/nbtscan.c | |
--- nbtscan-1.5.1~/nbtscan.c 2003-06-06 14:14:00.000000000 +0200 | |
+++ nbtscan-1.5.1/nbtscan.c 2008-05-09 14:38:59.000000000 +0200 | |
@@ -111,7 +111,7 @@ | |
for(i=0; i< hostinfo->header->number_of_names; i++) { | |
service = hostinfo->names[i].ascii_name[15]; | |
strncpy(name, hostinfo->names[i].ascii_name, 15); | |
- name[16]=0; | |
+ name[15]=0; | |
printf("%-17s Service: 0x%02x Flags: 0x%04x\n", name, service, hostinfo->names[i].rr_flags); |
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
diff -urNad nbtscan-1.5.1~/list.c nbtscan-1.5.1/list.c | |
--- nbtscan-1.5.1~/list.c 2008-05-08 14:10:54.000000000 +0200 | |
+++ nbtscan-1.5.1/list.c 2008-05-08 14:12:29.000000000 +0200 | |
@@ -49,7 +49,7 @@ | |
if(item1==NULL) return 1; | |
if(item1->content == item2->content) return 0; | |
if(item1->content > item2->content) return 1; | |
- if(item1->content < item2->content) return -1; | |
+ return -1; | |
}; |
NewerOlder