This gist is updated daily via cron job and lists stats for npm packages:
- Top 1,000 most depended-upon packages
- Top 1,000 packages with largest number of dependencies
- Top 1,000 packages with highest PageRank score
extension UIView { | |
func preventScrollViewScreenshotRecursive() { | |
guard superview != nil else { | |
for subview in subviews { | |
subview.preventScrollViewScreenshotRecursive() | |
} | |
return | |
} | |
let guardTextField = UITextField() | |
guardTextField.backgroundColor = .red |
[ | |
{ | |
"name": "Afghanistan", | |
"dial_code": "+93", | |
"code": "AF", | |
"flag": "🇦🇫" | |
}, | |
{ | |
"name": "Aland Islands", | |
"dial_code": "+358", |
extension UIView { | |
func preventScreenshot() { | |
DispatchQueue.main.async { | |
let field = UITextField() | |
field.isSecureTextEntry = true | |
self.addSubview(field) | |
field.centerYAnchor.constraint(equalTo: self.centerYAnchor).isActive = true | |
field.centerXAnchor.constraint(equalTo: self.centerXAnchor).isActive = true | |
self.layer.superlayer?.addSublayer(field.layer) | |
field.layer.sublayers?.first?.addSublayer(self.layer) |
#!/usr/bin/python3 | |
import requests | |
url = "http://127.0.0.1:8000/api/test" | |
payload={} | |
headers = { | |
'Accept': 'application/json', | |
'Authorization': 'Bearer xxxxx' #add your API token |
#!/bin/sh | |
set -e | |
vendor/bin/phpunit | |
(git push) || true | |
git checkout production | |
git merge master |
#! /bin/bash | |
# ECHO COMMAND | |
# echo Hello World! | |
# VARIABLES | |
# Uppercase by convention | |
# Letters, numbers, underscores | |
NAME="Bob" | |
# echo "My name is $NAME" |
/* debug.css | MIT License | zaydek.github.com/debug.css */ if (!("is_debugging" in window)) { is_debugging = false; var debug_el = document.createElement("style"); debug_el.append(document.createTextNode(`*:not(g):not(path) { color: hsla(210, 100%, 100%, 0.9) !important; background: hsla(210, 100%, 50%, 0.5) !important; outline: solid 0.25rem hsla(210, 100%, 100%, 0.5) !important; box-shadow: none !important; filter: none !important; }`)); } function enable_debugger() { if (!is_debugging) { document.head.appendChild(debug_el); is_debugging = true; } } function disable_debugger() { if (is_debugging) { document.head.removeChild(debug_el); is_debugging = false; } } !is_debugging ? enable_debugger() : disable_debugger(); |
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success 🎉 | |
console.log(response); | |
} catch (error) { | |
// Error 😨 |
%option noyywrap | |
%x C_COMMENT | |
%% | |
"/*" { BEGIN(C_COMMENT); } | |
<C_COMMENT>"*/" { BEGIN(INITIAL); } | |
<C_COMMENT>. { } | |
<C_COMMENT>\n { } |