Skip to content

Instantly share code, notes, and snippets.

View liron-navon's full-sized avatar

Liron Navon liron-navon

  • Israel
View GitHub Profile
@cecilemuller
cecilemuller / example.yml
Created October 20, 2020 01:49
Run Docker Compose + in Github Action
name: Test
on:
push:
branches:
- main
- features/**
- dependabot/**
pull_request:
branches:
/* eslint-disable no-undef */
const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const isDevelopment = process.env.NODE_ENV === 'development'
const alias = {
jQuery: path.resolve('./node_modules/jquery'),
@xirixiz
xirixiz / Set up GitHub push with SSH keys.md
Last active November 18, 2025 13:31 — forked from developius/README.md
Set up GitHub push with SSH keys

SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)

Create a repo.

Make sure there is at least one file in it (even just the README.md)

Generate a SSH key pair (private/public):

ssh-keygen -t rsa -C "your_email@example.com"
@rafaelrozon
rafaelrozon / mock_axios_storybook.jsx
Last active April 26, 2023 12:29
Mock Axios requests in Storybook
import React from 'react';
import { storiesOf } from '@storybook/react';
// 1. import axios and MockAdapter
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
// 2. create the mock
const mock = new MockAdapter(axios);
@dopey
dopey / main.go
Last active September 27, 2025 17:07 — forked from denisbrodbeck/main.go
How to generate secure random strings in golang with crypto/rand.
package main
import (
"crypto/rand"
"encoding/base64"
"fmt"
"io"
"math/big"
)
@malko
malko / urlBase64ToUint8Array.js
Created March 31, 2017 12:58
used in pushManager.Subscribe to correctly encode the key to a Uint8Array
function urlBase64ToUint8Array(base64String) {
const padding = '='.repeat((4 - base64String.length % 4) % 4);
const base64 = (base64String + padding)
.replace(/\-/g, '+')
.replace(/_/g, '/')
;
const rawData = window.atob(base64);
return Uint8Array.from([...rawData].map((char) => char.charCodeAt(0)));
}
@pauloremoli
pauloremoli / create_user_postgres.md
Last active February 26, 2025 16:18
Create postgresql user Mac OS X

Create postgresql user Mac OS X

After installing the postgres app: http://postgresapp.com/

It will create a database user with the current username, to create another user for example 'postgres':

$ createuser postgres -s

Open psql with the created user using -U

$ psql postgres -U postgres

@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote