Skip to content

Instantly share code, notes, and snippets.

View gangadharjannu's full-sized avatar
🎯
Focusing

Gangadhar gangadharjannu

🎯
Focusing
  • Amsterdam
View GitHub Profile
@chapmanjacobd
chapmanjacobd / gitls.md
Last active December 1, 2023 05:09
a few interesting git commands

gitls

git ls-files --sparse --full-name -z | 
  xargs -0 -I FILE -P 20 git log --date=iso-strict-local --format='%ad %>(14) %cr %<(5) %an  %h ./FILE' -- FILE | 
  sort --general-numeric-sort

This lists the files and hashes for each git commit and file:

2021-12-05T13:32:32-06:00  1 year, 11 months ago  Jacob Chapman  cc91fa0 ./.gitattributes

2021-12-05T13:32:32-06:00 1 year, 11 months ago Jacob Chapman cc91fa0 ./.gitignore

@bitroniq
bitroniq / Converting-multi-line-PEM-file-to-single-line-string.md
Last active August 28, 2024 13:55
Converting multi line PEM file to single line string
  1. Generate private key
openssl genrsa -out privatekey.pem 1024
Generating RSA private key, 1024 bit long modulus (2 primes)
......................+++++
....................+++++
e is 65537 (0x010001)
@lemmensaxel
lemmensaxel / Auth.tsx
Last active September 18, 2024 11:01
React-native expo + keycloak PKCE flow implemented using expo AuthSession
import {
ActivityIndicator,
Button,
ScrollView,
Text,
View,
} from "react-native";
import * as AuthSession from "expo-auth-session";
import * as WebBrowser from "expo-web-browser";
import { useEffect, useState } from "react";
@coltenkrauter
coltenkrauter / nginx.conf
Created January 23, 2021 21:36
Nginx configuration for SPAs (Single page applications) such as React or Angular
# https://www.zeolearn.com/magazine/setting-caching-headers-for-a-spa-in-nginx-cache
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
# X-Frame-Options is to prevent from clickJacking attack
add_header X-Frame-Options SAMEORIGIN;
@navix
navix / local-storage.ts
Last active July 3, 2024 01:10
Angular LocalStorage/SessionStorage services. Universal (SSR) compatible.
import { Platform } from '@angular/cdk/platform';
import { Injectable } from '@angular/core';
import { MemoryStorage } from './memory-storage';
@Injectable({
providedIn: 'root',
})
export class LocalStorage implements Storage {
private readonly storage: Storage;
@ppoffice
ppoffice / README.md
Last active September 22, 2024 17:42
Install Visual Studio Code (actually code-server) on Android
  1. Install Termux, an Android terminal emulator that provides a Linux execution environment and various tools.

  2. Update system packages in Termux:

    $ pkg update -y
@binura-g
binura-g / single-line-cert.sh
Last active August 28, 2024 13:55
Convert Certificates ( .pem, / .crt / etc ) into single-line strings for JSON payloads
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' cert-name.pem
@amlwwalker
amlwwalker / example.js
Created October 30, 2018 11:50
compiling and sending ehter to a payable function from nodejs
import ethers, {
Contract,
providers as Providers,
utils as Utils,
Wallet,
ContractFactory
} from "ethers"
import path from "path"
import fs from "fs"
@pgilad
pgilad / Instructions.md
Last active March 27, 2024 12:59
Generate SSL Certificate for use with Webpack Dev Server (OSX)

Generate private key

$ openssl genrsa -out private.key 4096

Generate a Certificate Signing Request

openssl req -new -sha256 \