Skip to content

Instantly share code, notes, and snippets.

View ishankhare07's full-sized avatar
👨‍💻

Ishan Khare ishankhare07

👨‍💻
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

The following script seemd to help, giving a list of m1 compatible provider versions:

PROVIDER="hashicorp/google"
curl --silent https://registry.terraform.io/v1/providers/${PROVIDER}/versions | jq -r '.versions[] | select(.platforms[] | contains ({"os": "darwin", "arch": "arm64"})) | .version'

Jumping words

To make this work for the right option key, you need to set the key modifier to act as an escape sequence.

First, you need to set your left ⌥ key to act as an escape character.

After that, you can either change the current shortcut for ⌥ ← or create a new one in the profile shortcut keys with the following settings:

Keyboard Shortcut: ⌥←

Action: Send Escape Sequence

@ishankhare07
ishankhare07 / chmod_perm.md
Last active May 2, 2019 07:38
converting between chmod permissions
Directory User Group Others (world) who
0 420 000 000 octal notations
0 110 000 000 bits
d rwx rwx rwx named permissions
0 6 0 0 chmod numeric mode
@ishankhare07
ishankhare07 / prime_seq.clj
Created April 3, 2019 07:44
prime number series generation in clojure
(defn prime? [x]
(def f (fn [i j]
(if (zero? (rem i j))
false
(if (<= j (quot i j))
(f i (+ j 1))
true
))))
(f x 2)
)
@ishankhare07
ishankhare07 / multiple_ssh_setting.md
Created January 24, 2019 11:13 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
def get_products_dict(products):
"""
Returns products dict with bundled products included to be used in email templates.
NOTE: DO NOT SAVE PRODUCT IN THIS METHOD, AS, WE ARE CHANGING PRICE OF BUNDLED PRODUCTS TO 0
"""
lang = get_language()[:2]
products_dict = {}
try:
if products and products[0].get('source') == 'vas':
for product in products:
@ishankhare07
ishankhare07 / desig_init.c
Created July 22, 2018 13:14
Perfectly valid C - designated initializers
#include <stdio.h>
#include <math.h>
typedef struct point {
int x;
int y;
} Point;
float distance(Point *p1, Point *p2) {
return sqrt(
/* -*- compile-command: "gcc -Wall -Werror -lcap -lseccomp contained.c -o contained" -*- */
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
#include <sched.h>
#include <seccomp.h>
#include <stdio.h>
#include <stdlib.h>
@ishankhare07
ishankhare07 / create_threads.c
Created April 1, 2018 20:14
create threads and wait using join
#include "stdio.h"
#include "assert.h"
#include "pthread.h"
void *myThread(void *arg) {
printf("%s\n", (char *) arg);
return NULL;
}
int main() {