Some stats: - Total number of links: 23983
Discover gists
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: http://dis.4chan.org/read/prog/1295544154/170 | |
function sleepSort(list, callback) { | |
const result = []; | |
list.forEach((i) => setTimeout(() => { | |
result.push(i); | |
if (result.length == list.length) { | |
callback(result); | |
} |
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
import re | |
from itertools import chain | |
def calculate_readability(code_string:str) -> float: | |
code = code_string.splitlines() | |
# Heuristic 1: Line length | |
max_line_length = 80 | |
long_lines = sum(1 for line in code if len(line) > max_line_length) |
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
import asyncio | |
import random | |
class Hub(): | |
def __init__(self): | |
self.subscriptions = set() | |
def publish(self, message): |
Documentación oficial sobre Jest
- Instalaciones de desarrollo (super test es útil para probar Express)
npm install -D jest @types/jest ts-jest supertest
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
For a more organised and more update list please visit https://github.com/RayZz-/LCU-Arguments | |
This list will no longer be updated please refer to the repo linked above | |
These are known command line arguments for the LCU(including helper) some maybe outdated | |
or overtime may become outdated or some information maybe incorrect | |
if you would like to contribute please comment with updated information. | |
Usage example: | |
--app-name=kappa |
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
[ | |
{ | |
"province": "اردبیل", | |
"cities": [ | |
"اردبیل", | |
"اصلاندوز", | |
"آبی بیگلو", | |
"بیله سوار", | |
"پارس آباد", | |
"تازه کند", |
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
/* | |
JPA (Java Persistence API) | |
Transaction Management with an Entity-Mananger: | |
--- | |
entityManager.getTransaction().begin(); | |
entityManager.persist(<some-entity>); | |
entityManager.getTransaction().commit(); | |
entityManager.clear(); |
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
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
# any name can be used; Velero uses the labels (below) | |
# to identify it rather than the name | |
name: change-storage-class-config | |
# must be in the velero namespace | |
namespace: velero | |
# the below labels should be used verbatim in your | |
# ConfigMap. |
Example of Kamal deployment from Github Actions.
Add your applications .env
variables to the Github repo as a repository secret, you can find this under the repo settings => secrets and variables => actions
https://github.com/username/repo_name/settings/secrets/actions
you are going to need an ssh private key that your deployment server is aware of (add public key to servers .ssh/authorized_keys) and add the ssh private key as a repo secret
create action workflows
NewerOlder