Skip to content

Instantly share code, notes, and snippets.

View jrichardsz's full-sized avatar

JRichardsz jrichardsz

View GitHub Profile
@jrichardsz
jrichardsz / github action snippets.md
Created November 20, 2024 22:12
github action snippets, github_actions, actions, githubactions

clone private repositories using pat token

 - name: Install requirements
      run: |
        git config --global url."https://${{ secrets.ACESS_TOKEN }}@github".insteadOf https://github
        git clone https://github.com/githubtraining/hellogitworld.git

https://stackoverflow.com/a/66094537/3957754

@jrichardsz
jrichardsz / nodejs unit test sinon.md
Created November 20, 2024 21:52
nodejs unit test sinon

stub field

This works for me with Sinon.JS v4.1.2:

myObject = {hello: 'hello'}
sandbox = sinon.createSandbox()
sandbox.stub(myObject, 'hello').value('Sinon')
myObject.hello // "Sinon"
sandbox.restore()
##--------------------------
## Terraform: Functions ##
##--------------------------
## Open terraform console
terraform console
#######################
## Numeric Functions ##
#######################
@jrichardsz
jrichardsz / devops sql - cdn.md
Last active October 1, 2024 23:48
devops sql

113512181-1a965b00-956c-11eb-8ac6-e046c11ba368

@jrichardsz
jrichardsz / environment variables snippets - nodejs.md
Created September 30, 2024 14:32
environment variables snippets
var express = require('express');
var app = express();

app.get('/', function(req, res) {
  res.type('text/plain');
  res.send('Hell , its about time!!');
});
@jrichardsz
jrichardsz / database advanced snippets - sql.md
Last active May 2, 2025 15:26
database advanced snippets

use quotes in table name

INNER JOIN acmeschema."FooTable"

solution

SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO

@jrichardsz
jrichardsz / sql dependencies - snippets - sqlserver.md
Created September 17, 2024 17:27
sql dependencies - snippets
SELECT OBJECT_NAME(referencing_id) AS referencing_entity_name,   
    o.type_desc AS referencing_desciption,   
    COALESCE(COL_NAME(referencing_id, referencing_minor_id), '(n/a)') AS referencing_minor_id,   
    referencing_class_desc,  
    referenced_server_name, referenced_database_name, referenced_schema_name,  
    referenced_entity_name,   
    COALESCE(COL_NAME(referenced_id, referenced_minor_id), '(n/a)') AS referenced_column_name,  
    is_caller_dependent, is_ambiguous  
FROM sys.sql_expression_dependencies AS sed 
@jrichardsz
jrichardsz / visual code vs snippets.md
Created September 12, 2024 16:34
visual code vs snippets

select regex results

alt+enter

@jrichardsz
jrichardsz / mobile dimensions snippets.md
Last active August 23, 2024 04:50
mobile dimensions snippets