teleren/devto huggingface dataset:
Lambda Code signing 
Published: 2021-08-09 06:42:16


 Lambda code signing enforce the integrity of your code and make sure that only trusted developers can deploy code to your AWS Lambda  functions. 

code signing for Lambda is to protect the deployment stage and give a cryptographically strong hash verification.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6i74p6ctq2h4jkdpq9rc.png)
 
 
## Admin  User

 1) Create a signing profile in AWS Signer 

 2) Give access  via IAM for developers to use this profile to 
    sign their artifacts  

 3) Create a code signing configuration (CSC) that specifies 
    the  signing profile  and the signature validation policy 
   (Warn or reject the deployments that fail the signature 
   check)

##Developer

 1) Use the signing profile to sign the deployment artifact 

 2) Deploy the signed deployment artifact to a function  
    (create/update lambda function)


## Code Signing deployment approach

Since code signing service  is the shared service ,the code signing profile and config creation ,assigning the permissions to developers via IAM can be part of common modules.

```
1) Profile Creation 

aws signer put-signing-profile \
    --profile-name signin_profile \
    --platform AWSLambda-SHA384-ECDSA

2) ADD permission via IAM

aws signer add-profile-permission \
--profile-name signin_profile \
--action signer:StartSigningJob \
--principal arn:aws:iam::XXXXXXXXXXXX:role/lambda-ex \
--statement-id signerstmtid

3 )Create signing config

 aws lambda create-code-signing-config \
--description "lambda config" \
--allowed-publishers SigningProfileVersionArns=arn:aws:signer:ap-southeast-2:XXXXXXXXX:/signing-profiles/signin_profile/XXXXX \
--code-signing-policies "UntrustedArtifactOnDeployment"="Enforce"
```


 Developers can use the signing profile to sign and deploy the 
 artifacts 

## Sign the deployment artifact

```
aws signer start-signing-job \ 
--source 's3={bucketName=<lambda-bucket>, version=<version-string>, key=main-function.zip}' \
--destination 's3={bucketName=<lambda-bucket>, prefix=signed-}' \
--profile-name signin_profile

## Deploy the Artifact 

aws lambda create-function \
    --function-name "signed-main-function" \
    --runtime "python3.8" \
    --role <lambda-role> \
    --zip-file "fileb://signed-main-function.zip" \
    --handler lambda_function.lambda_handler \ 
    --code-signing-config-arn <code-signing-config-arn>
```
DevBox - Everyday utilities for the everyday developer
Tags: news, showdev, tauri, mintlang
Published: 2021-08-09 06:37:25

I'm happy to launch [DevBox](https://www.dev-box.app/)  (https://www.dev-box.app/) 🎉 🚀 a desktop app of small useful of software (encoders, decoders, generators, viewers, etc.) that every developer should have!

Read on for more information, and check the end of the post for a discount!
 
---------

I always used an online app for some small task that I needed to do during development. For example, when I needed to explore a minified JSON file, I would do the following:

— search for `JSON viewer online`
— try the first couple of results with varying success
— find one that works
— check the JSON
— forget that this ever happened 😂 

Seems familiar? 😉

I would go through the same steps for other tasks as well:

— check difference of two texts
— format XML files
— generate QR codes
— generate dummy text (lorem ipsum)
— generate color palette
— minify SVGs
— etc.

So after the nth time I decided to create a desktop application that has all this, so the next time anyone could just use that and save some time!

--------

DevBox is now available with [16 of these utilities](https://www.dev-box.app/#utilities), which I'm sure can help you in the days to come 😊

If that's something you want, you can buy it [here](https://gdotdesign.gumroad.com/l/devbox/earlybird) for a lifetime price of ~~$25~~ $20 💰 (20% discount for the first 100 purchases) with all future updates included. 

I'm planning on adding more utilities continuously and releasing new versions when 5 utilities are ready (whenever that will be). Keep in mind that the price will go up with more utilities, so you should buy it now to get the best price!

-------

Since we are developers here, here is the technology that I used to create DevBox:

— [Mint](https://www.mint-lang.com/) — Programming Language to create single page applications (and obviously desktop as well 😂)
— [Mint UI](https://ui.mint-lang.com/) — Component Library for Mint
— [Tauri](https://tauri.studio/en/) — Allows us to create desktop applications that use the OS web-view (think of it as Electron alternative)

I'll be releasing a post about the setup sometime soon, so follow me if you want to be notified!

PS: macOS app notarization really sucks! 😬

-------

If you have any feedback, ideas, utilities to add, or questions, let me know in the comments below! 💬 🙏🏻
HTML tags | abbr
Tags: html, tags, abbr
Published: 2021-08-09 06:11:54

It is used to **define an abbreviation or an acronym**.

It has an optional `title` attribute which, if present, must contain exclusively the complete description of the abbreviation or acronym (eg: `<abbr title="HyperText Markup Language">HTML</abbr>`).

This `title` attribute can be used by browsers to **present a tooltip** when hovering and can be displayed in various ways, usually with a dotted bottom border and sometimes with uppercase text. Any of these styles is modifiable by CSS.

Using `<abbr>` in a definition in the document **does not link said definition to the same abbreviation or acronym in other parts of the text**, it will be necessary to use `<abbr>` as many times as deemed appropriate. But **it should not be added on all occasions** when the term is presented, only when it is considered that it adds value to the user and is not redundant.

For accessibility reasons, **it is often useful to use it at least the first time the term appears in the document**, especially when the content is technical or includes special jargon.

- Type: *inline*
- Self-closing: *No*
- Semantic value: *No*

[Definition and example](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/abbr) | [Support](https://caniuse.com/mdn-html_elements_abbr)
Can we have custom media queries, please?
Tags: css
Published: 2021-08-09 06:01:59

---
title: Can we have custom media queries, please?
published: true
description: CSS custom properties don't work in media queries. Custom media queries could help out here but unfortunately, they're not supported yet.
tags: css
canonical_url: https://www.stefanjudis.com/notes/can-we-have-custom-media-queries-please/
---

Today I discovered an exciting section in the CSS media queries Level 5 spec. [The custom media queries section explains how to define and reuse aliases for media queries](https://drafts.csswg.org/mediaqueries-5/#custom-mq). Why would you need that?

Well... if you're using CSS custom properties and wanted to use them in a media query, you probably discovered that you can't use custom properties in this context. CSS custom properties weren't designed for that use case. Bummer!

```css
:root {
  --width: 20em;
}

/* that doesn't work :/ */
@media (min-width: var(--width)) {
}

```

You could now rely on tools such as Sass and introduce another non-native variable system to clean up your media queries, but yeah... this approach is not great!

But here's the solution – __say hello to custom media queries__!

```css
@custom-media --narrow-window (max-width: 30em);

@media (--narrow-window) {
  /* narrow window styles */
}
```

Isn't this beautiful? I think many web developers are waiting for that for quite some time. But here's the sad news: you can't use custom media queries today because it's only future music. 

I googled around for a few minutes, and apparently, [custom media queries are in the spec for years](https://github.com/w3c/csswg-drafts/blame/main/mediaqueries-5/Overview.bs#L2445-L2456). There doesn't seem to be much interest in implementing it, though. Neither MDN nor caniuse.com knows about the feature. :/

If you want to use it today, leverage PostCSS and [the Custom Media plugin](https://github.com/postcss/postcss-custom-media). That's better than nothing, but hey... can we have custom media queries, please?
javascript live and static selector
Tags: javascript, php, node, python
Published: 2021-08-09 05:56:00

##Live selector 
live selector track element in html document in active form if new element found in document then select that new element  by active selector
list of live selector 
1.document.getElementsByClassName()
2.document.getElementsByName()
3.document.getElementsByTagName()
```html
<h1> live selector</h1>
<p class='first'>fisrt</p>
<p class='first'>second</p>
<p class='first'>third</p>
```
```javascript
var element = document.getElementsByClassName('first');

  for(let i=0;i<element.length;i++){
    console.log(i);
    }

setInterval(function(){
   for(let i=0;i<element.length;i++){
    console.log(i);
    }
},1000);

var newElmnt = document.createElement('p');
newElmnt.className='first';
var textNode = document.createTextNode('welcome to dev community ');
newElmnt.appendChild(textNode);

document.body.append(newElmnt);
```
```
output
0
1
2
output after 1 second
0
1
2
3
```

#Static selector 
Only one static selector in javascript 
1.document.querySelectorAll()
Static selector select element from document in first time code execute after code execute any new element insert in document then static selector does not select new element
```javascript
var element = document.querySelectorAll('.first');

  for(let i=0;i<element.length;i++){
    console.log(i);
    }


setInterval(function(){
   for(let i=0;i<element.length;i++){
    console.log(i);
    }
},1000);

var newElmnt = document.createElement('p');
newElmnt.className='first';
var textNode = document.createTextNode('welcome to dev community ');
newElmnt.appendChild(textNode);

document.body.append(newElmnt);

```
```
output
0
1
2
output after 1 second are same 
0
1
2
```
these are major difference between live and static selector
learn more about javascript tips please visit my website [fast2learning](https://halflearning.com)
CoThings: A realtime counter for shared things.
Tags: elixir, ios, swift, opensource
Published: 2021-08-09 05:46:09

It accounts for current number of people using shared areas or utilities in realtime. It uses Elixir + Phoenix’s Socket for realtime communication.

With mobile application it monitors beacons in background to update the room current status.

More about the project: https://cothings.app
Save time remembering SSH hosts
Tags: ssh, zsh, terminal, linux
Published: 2021-08-09 05:02:55

As part of my work I regularly have to SSH into various hosts to perform some actions or to debug issues.
Every time I do it, I head to our internal cloud dashboard to figure out the IP address of the host that I need to SSH into. There are a few hosts for particular services that I SSH into very frequently, almost on a daily basis.

It is not possible to remember IP addresses, which look like 10.12.13.14.

Assigning a name is easier. I now have created aliases for my most frequently used hosts.

On the `~/.zshrc` file, I added:

`alias ssh-service-env-zone="ssh ipaddress"`

The next time I wish to SSH into `ipaddress`, I can just do a `ssh-service-env-zone`.

This gets even better with `Auto Suggestions and Syntax Highlighting`. For details check out this [blog](https://pradipta.github.io/terminal-setup-on-mac/)
Tailwind CSS Simple Responsive Landing Page Template
Tags: tailwindcss, alpinejs, css, webdev
Published: 2021-08-09 04:49:09

Tailwind CSS simple landing page template. It’s fully responsive and built with Tailwind CSS and alpinejs .  You can easily able to customize it for your needs.

![larainfo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w1oonjw3xk3be0sgzsp3.png)

####FEATURES & Tools Use:
Tailwind CSS 2.x

Alpinejs 2.x

Heroicons

Responsive Navbar with Hamburger Menu

About Us Section 

Our Blog Section

Contact Form Section

Easy to Customize


👉 [View Demo](https://larainfo.com/blogs/tailwind-css-simple-responsive-landing-page-template)
How to use JReleaser and release to github
Published: 2021-08-09 04:15:41

---
title: How to use JReleaser and release to github
published: true
description: We look into how to use jreleaser and deploy our code to Github and creating release documentation with some simple steps.
tags:
cover_image: 
---

{% youtube bFem3y431Fk %}

We look into how to use jreleaser and deploy our code to Github and creating release documentation with some simple steps.
[mincraft][forge1.16] example code: Explode on block placed
Tags: minecraft, forge
Published: 2021-08-09 04:10:00


Make explode on BlockEvent.EntityPlaceEvent

```java
package com.nshmura.doromod;

import net.minecraft.entity.Entity;
import net.minecraft.world.Explosion;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

@Mod(ExampleMod.MOD_ID)
public class ExampleMod {
    public static final String MOD_ID = "examplemod";

    // Directly reference a log4j logger.
    private static final Logger LOGGER = LogManager.getLogger(MOD_ID);

    public ExampleMod() {
        MinecraftForge.EVENT_BUS.register(this);
    }

    @SubscribeEvent
    public void on(BlockEvent.EntityPlaceEvent event) {
        Entity entity = event.getEntity();
        entity.getCommandSenderWorld().explode(
                entity,
                entity.position().x,
                entity.position().y,
                entity.position().z,
                4.0F,
                Explosion.Mode.NONE
        );
    }
}
```
How To Delete Multiple Records Using Checkbox In Laravel
Tags: laravel, php, mysql, javascript
Published: 2021-08-09 03:44:35

In this example I will show you how to delete multiple records using checkbox in Laravel or delete multiple rows in Laravel using jQuery.

Many times we have multiple record in database and whenever we want to delete records it is time consuming to delete records one by one, So, in this example we can delete multiple records using checkbox or we can delete all records at a same time,

So, let's start and follow below steps.

```
Step 1 : Install Laravel Application
Step 2 : Database Setup
Step 3 : Add Dummy Records Using Tinker
Step 4 : Create Controller DeleteUserController
Step 5 : Add Route
Step 6 : Create Blade File For View
```

---

> **_[Read More : How To Delete Multiple Records Using Checkbox In Laravel](https://www.techsolutionstuff.com/post/how-to-delete-multiple-records-using-checkbox-in-laravel)_**

---

You May Also Like To Read :

1. **_[Read More : Create Dummy Data Using Tinker In Laravel](https://www.techsolutionstuff.com/post/create-dummy-data-using-tinker-in-laravel)_**

2. **_[Read More : Import Export CSV/EXCEL File In Laravel](https://www.techsolutionstuff.com/post/import-export-csv-excel-file-in-laravel)_**

3. **_[Read More : Laravel Datatable Example Tutorial](https://www.techsolutionstuff.com/post/laravel-datatable-example-tutorial)_**

---

Thank you for reading. I hope you enjoyed the article!.
Don't Forgot to Like and Share.
LeetCode 91. Decode Ways
(javascript solution)
Tags: algorithms, javascript
Published: 2021-08-09 04:05:39

###Description:

A message containing letters from A-Z can be encoded into numbers using the following mapping:

'A' -> "1"
'B' -> "2"
...
'Z' -> "26"
To decode an encoded message, all the digits must be grouped then mapped back into letters using the reverse of the mapping above (there may be multiple ways). For example, "11106" can be mapped into:

"AAJF" with the grouping (1 1 10 6)
"KJF" with the grouping (11 10 6)
Note that the grouping (1 11 06) is invalid because "06" cannot be mapped into 'F' since "6" is different from "06".

Given a string s containing only digits, return the number of ways to decode it.

The answer is guaranteed to fit in a 32-bit integer.

###Solution:
Time Complexity : O(n)
Space Complexity: O(n)

```javascript
// DP solution
var numDecodings = function(s) {
    // Create dp array
    const dp = Array(s.length+1).fill(0);
    // If the first number is 0 then return we cannot decode this string
    if(s[0]==='0') return 0
    // Base cases
    dp[0] = 1;
    dp[1] = 1
    
    for(let i = 2; i <= s.length; i++) {
        // Get values for one and two digit numbers
        const oneDigit = +s.slice(i-1, i);
        const twoDigits = +s.slice(i-2, i);
        // Check if one digit and/or two digit numbers are valid
        if(oneDigit > 0) dp[i] = dp[i-1];
        if(twoDigits >= 10 && twoDigits <= 26) dp[i] += dp[i-2]
    }    
    return dp[s.length];
};
```
Logstash: Get Started
Published: 2021-08-09 03:41:27

Code: https://github.com/codebangkok/elastic

####ติดตามผลงานได้ที่
Page: https://fb.com/CodeBangkok​
Group: https://fb.com/groups/msdevth​
Blog: https://dev.to/codebangkok
YouTube: https://youtube.com/CodeBangkok
Día>2 de Proyecto
Published: 2021-08-09 03:30:24

Hoy es 8/8/21. No documenté "realtime" mis pensamientos sobre mis avances del proyecto, pero honestamente estoy bastante feliz con mis resultados en el primer sprint. Logré realizar las tareas que propusimos con mis compañeros (a excepción de la GUI, eso lo dejaré de último).

Estoy feliz con mis resultados debido a que entendí ANTLR y cómo funciona el Listener de manera rápida, además que mis compañeros hicieron una manera más difícil de realizar las cosas, por lo que cuando les enseñé el listener y cómo implementar alguna regla cualquiera, fueron bastante agradecidos en que haya descubierto cómo utilizar el listener.

Las reglas hasta el momento que he implementado son: num en declaración de arreglo debe ser mayor a 0, chequeos de return (si es void no debe tener valor de retorno), implementación de comentarios a gramática, y comencé a desarrollar una tabla de símbolos preliminar para discutirla en la clase de mañana.
What did you teach this week? (1-8 Aug)
Tags: discuss, teachingthisweek, teaching
Published: 2021-08-09 03:12:04


 Welcome all! Did you teach anyone anything this week? I am sure you did. Think carefully and post in the comments below! 
---
_____

*Teaching can be like.......*
- Lending a helping hand to your Colleague in learning a new concept 
- Posting a blog which teaches a new technology
- Answering on Stack Overflow
- Participating in group training activities

 *....................and many other ways*

![teacgher](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ex3xvf47nnq99aecrrd1.gif)

So regardless how much you have taught, whome you have taught or how you have taught, please comment below. Let us all join together and create a source of positive energy by teaching others.  

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ofbjeoc07h4qxojsh187.png)
Vue 프로젝트의 단짝, VueUse
Tags: javascript, korean, vue
Published: 2021-08-09 02:42:14

**[VueUse](https://vueuse.org/)**

## 왜 사용해야 하는가?

- Vue 2 & 3 지원 (Vue 2의 경우 일부 기능 미지원)
- CSS 애니메이션, 브라우저, 컴포넌트 등의 유용한 헬퍼를 `Use` 함수로 제공
- `Composition API` 사용으로 금방 친숙 (당연하겠지만 Options API 및 Composition API 모두 사용 가능)
- 큰 커뮤니티, 검증된 함수

리액트 Hooks가 즐겁다? 그러면 마참내 [react-use](https://github.com/streamich/react-use) 도 즐겁다!

## 설치하기

```sh
npm i @vueuse/core
# 또는
yarn add @vueuse/core
# pnpm 쓰고싶다...
```

UMD 사용 시
```html
<script src="https://unpkg.com/@vueuse/shared"></script>
<script src="https://unpkg.com/@vueuse/core"></script>
```

## 주요 함수

- [`useTransition`](https://vueuse.org/core/usetransition/): CSS 트랜지션 생성에 도움을 준다.
- [`useActiveElement`](https://vueuse.org/core/useactiveelement/) - [`document.activeElement`](https://developer.mozilla.org/ko/docs/Web/API/Document/activeElement) 의 반응성 추가! 
- [`useClipboard`](https://vueuse.org/core/useclipboard/): 반응성이 생신 클립보드 API
- [`useFetch`](https://vueuse.org/core/usefetch/): `Fetch API`에 반응성이 무슨 의미가 있나고? 이 함수를 통해 URL을 `ref` 함수로 초기화해서 넣기만 하면 URL 값이 바뀔 때마다 내용도 바뀐다!
- [`useTitle`](https://vueuse.org/core/useclipboard/): 문서 제목을 동적으로 바꾸면서 Vue스럽게 원한다면 이만한 놈이 없다.
- [`templateRef`](https://vueuse.org/core/templateref/): [Composition API 에서 `ref` 지정한 요소를 가져오기엔 뭔가 좀 이상하다.](https://v3.ko.vuejs.org/ko-KR/guide/composition-api-template-refs.html#template-refs). 하지만 이걸 쓰면 기존 `ref` 요소를 `ref` 함수 쓰듯이 쓸 수 있다. 
- [`useWebSocket`](https://vueuse.org/core/useclipboard/): 웹소켓을 Vue 컴포넌트에 연결하는 엘레강스한 방법.
- [`onClickOutside`](https://vueuse.org/core/onclickoutside/): 컴포넌트 요소 밖으로 마우스 클릭을 감지해서 대응하는 손쉬운 방법!
- [`useParallax`](https://vueuse.org/core/useparallax/): 입체적인 효과를 반응형으로 즐기고 싶다면 이 함수가 손쉽게 수치를 제공해 준다.
- [`useStorage`](https://vueuse.org/core/usestorage/): `LocalStorage`/`SessionStorage` 내 지정된 값을 반응형으로? JSON 객체도 알아서 직렬화 및 해석도 해준다!
- [`asyncComputed`](https://vueuse.org/core/asynccomputed/): 기본적으로 `computed` 함수는 비동기를 지원하지 않는다. (왠만한 반응형 함수 마찬가지로 비동기 미지원) 비동기가 필요하다면 이걸 쓰면 된다.
- [`useDebounce`](https://vueuse.org/shared/usedebounce/): 자주 바뀔 때, 일정 간격 **이후** 반응해서 안정적인 컴포넌트 새로고침이 필요하다면 이걸 쓰면 된다.
- [`useThrottle`](https://vueuse.org/shared/usethrottle/): 자주 바뀔 때, 일정 간격 **마다** 반응해서 안정적인 컴포넌트 새로고침이 필요하다면 이걸 쓰면 된다.
- [`useRefHistory`](https://vueuse.org/core/userefhistory/): 반응형 데이터 + `undo` + `redo` 기능까지 한 번에? 세상에나!

## 확장

이들은 추가 설치가 필요하다.

- Electron `npm i @vueuse/electron`
 - [`useIpcRenderer`](https://vueuse.org/electron/useIpcRenderer/)
- Firebase `npm i @vueuse/firebase`
 - [`useFirestore`](https://vueuse.org/firebase/useFirestore/)
- Integrations `npm i @vueuse/integrations`
 - [`useAxios`](https://vueuse.org/integrations/useAxios/) - `axios` 를 통해 데이터를 가져왔다면 반응형으로 부드럽게!
 - [`useJwt`](https://vueuse.org/integrations/useJwt/) `jwt-decode` 모듈을 통해 반응형 JWT 토큰 내 `payload` 데이터도 반응형으로!
- Vue Router 4 `npm i @vueuse/router` (Vue 3 전용)
 - [`useRouteQuery`](https://vueuse.org/router/useRouteQuery/) - URL 뒤에 물음표로 시작하는 질의 키/값을 반응형으로 가져올 수 있다.
- RxJS `npm i @vueuse/rxjs`