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/zsh | |
nap() { | |
print "Taking a nap..." | |
command sleep 3 | |
} | |
TRAPINT() { | |
# Remove the printed '^C' from the console. | |
print -n "\x1b[2D" |
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
// QRious v4.0.2 | (C) 2017 Alasdair Mercer | GPL v3 License Based on jsqrencode | (C) 2010 [email protected] | GPL v3 License | |
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.QRious=e()}(this,function(){"use strict";function t(t,e){var n;return"function"==typeof Object.create?n=Object.create(t):(s.prototype=t,n=new s,s.prototype=null),e&&i(!0,n,e),n}function e(e,n,s,r){var o=this;return"string"!=typeof e&&(r=s,s=n,n=e,e=null),"function"!=typeof n&&(r=s,s=n,n=function(){return o.apply(this,arguments)}),i(!1,n,o,r),n.prototype=t(o.prototype,s),n.prototype.constructor=n,n.class_=e||o.class_,n.super_=o,n}function i(t,e,i){for(var n,s,a=0,h=(i=o.call(arguments,2)).length;a<h;a++){s=i[a];for(n in s)t&&!r.call(s,n)||(e[n]=s[n])}}function n(){}var s=function(){},r=Object.prototype.hasOwnProperty,o=Array.prototype.slice,a=e;n.class_="Nevis",n.super_=Object,n.extend=a;var h=n,f=h.extend(function(t,e,i){this.qrious=t,this.element=e,this |
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
A = [1, 3, 6, 4, 1, 2] | |
s = set(A) | |
i = 1 | |
while True: | |
if i not in s: | |
return i | |
else: | |
i += 1 |
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 Solution: | |
def maxSubArray(self, nums: List[int]) -> int: | |
# Initialize our variables using the first element. | |
current_subarray = max_subarray = nums[0] | |
# Start with the 2nd element since we already used the first one. | |
for num in nums[1:]: | |
# If current_subarray is negative, throw it away. Otherwise, keep adding to it. | |
current_subarray = max(num, current_subarray + num) | |
max_subarray = max(max_subarray, current_subarray) |
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
function fuzzy-search-history() { | |
# Assemble the list of commands found in history, | |
# such that it only contains the most recent occurrence | |
# of a particular command. | |
typeset -a entries=() | |
for line in ${(f)"$(fc -nl 1)"}; do | |
entries+=${${line//\\n/ }//\\t/ }; | |
done | |
BUFFER=$( | |
print -l ${(Oau)entries} \ |
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
||js.driftt.com/core$subdocument | |
||ogs.google.com/u/0/widget/callout/sid$subdocument | |
||player.vimeo.com/video/568544033$subdocument | |
||publisher.liveperson.net/iframe-le-tag/iframe.html?lpsite=60270350&lpsection=store-sales-en-us&buttons=lpChatService,lpChatSales$subdocument | |
askubuntu.com##.js-consent-banner | |
askubuntu.com##.ps-relative.js-freemium-cta | |
audio.microsoft.com##.context-uhf.uhfc-universal-context | |
bizbrains.com###coiOverlay | |
configure.zsa.io##.hurnZj.sc-hiSbYr | |
configure.zsa.io##.ioWVHA.sc-dkmKpi |
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 man://apt.conf(5) | |
# | |
# /etc/apt/apt.conf is the main configuration file shared by all the tools in the APT suite | |
# of tools, though it is by no means the only place options can be set. The suite also | |
# shares a common command line parser to provide a uniform environment. | |
# | |
# When an APT tool starts up, it will check the environment for the parameter | |
# APT_CONFIG, and read in values from that location if there are any. Else, `apt` | |
# will default to searching /etc/apt/apt.conf and /etc/apt/apt.conf.d/* for | |
# any additional configurations. |
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
.TH "ZSHCONTRIB" "1" "February 14, 2020" "" "" | |
.hy | |
.SH NAME | |
.PP | |
zshcontrib - user contributions to zsh | |
.SH DESCRIPTION | |
.PP | |
The Zsh source distribution includes a number of items contributed by the user | |
community. | |
These are not inherently a part of the shell, and some may not be available in |
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
function cling { | |
if (( ${#} != 1 )); then | |
echo "usage: \`cling VERSION\` " >&2 | |
return 1 | |
fi | |
typeset version=${1} | |
typeset priority=$(( ${version} * 10 )) |
NewerOlder