Skip to content

Instantly share code, notes, and snippets.

View kuchhadiyaa's full-sized avatar
🏠
Working from home

Kuchhadiya Akshay kuchhadiyaa

🏠
Working from home
View GitHub Profile
@CMQNordic
CMQNordic / vue-nuxt-reference-guide.md
Last active May 26, 2022 08:38
Vue & Nuxt | Quickly refresh your skills | Written by Martin Czerwinski @ CMQ Nordic

Reference Guide - Vue & Nuxt

This document helps you to refresh your Vue skills and can also be used for quick look-ups. This reference guide was written with love and broken english, for myself, by myself as notes for myself, educational purposes and just for for fun.

(This document is not fully finished still work in progress)

Written by Martin Czerwinski ®CMQ Nordic AB | Feb 2021

@justjavac
justjavac / GetOptimizationStatus.md
Last active March 31, 2024 06:30
V8 %GetOptimizationStatus

%GetOptimizationStatus return a set of bitwise flags instead of a single value, to access the value, you need to take the binary representation of the returned value. Now, for example, if 65 is returned, the binary representation is the following:

(65).toString(2).padStart(12, '0');
// 000001000001

Each binary digit acts as a boolean with the following meaning:

@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 10, 2024 20:23
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@dionc
dionc / MapKitExtensions.swift
Last active January 27, 2024 00:54
Create an MKCoordinateRegion from an array of coordinates. Safely handles coordinates that cross the 180th meridian.
import MapKit
extension MKCoordinateRegion {
init?(coordinates: [CLLocationCoordinate2D]) {
// first create a region centered around the prime meridian
let primeRegion = MKCoordinateRegion.region(for: coordinates, transform: { $0 }, inverseTransform: { $0 })
// next create a region centered around the 180th meridian
@wwsean08
wwsean08 / ami_prune.py
Last active August 25, 2017 07:14
A lambda function that can be used to prune AMIs based on how old they are
from __future__ import print_function
import os
import boto3
from datetime import datetime, timedelta
from dateutil.parser import parse
THRESHOLD = int(os.getenv('threshold_days', 30))
ENABLE_DELETE = os.getenv('enable_delete', False)
REGION = os.getenv('region', 'us-east-1')
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active April 16, 2024 17:26 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@steipete
steipete / ios-xcode-device-support.sh
Last active December 12, 2023 03:36
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)
@pwlin
pwlin / gist:8a0d01e6428b7a96e2eb
Last active April 10, 2024 12:44
Android : add cert to system store
https://code.google.com/p/android/issues/detail?id=32696#c5
If you have a certificate that is not
trusted by Android, when you add it, it goes in the personal cert store.
When you add a cert in this personal cert store, the system requires a
higher security level to unlock the device. But if you manage to add your
cert to the system store then you don't have this requirement. Obviously,
root is required to add a certificate to the system store, but it is quiet
easy.
@steipete
steipete / PSPDFThreadSafeMutableDictionary.m
Created December 2, 2013 09:00
Dictionary subclass whose primitive operations are thread safe. Most of the time you don't want locking at the collection level, but there are valid use cases for this, and it's interesting how to properly subclass the NSDictionary class cluster. We're using SpinLocks here, since it's highly unlikely that any of the operation locks for more than…
@interface PSPDFThreadSafeMutableDictionary : NSMutableDictionary
@end
#import "PSPDFThreadSafeMutableDictionary.h"
#import <libkern/OSAtomic.h>
@implementation PSPDFThreadSafeMutableDictionary {
OSSpinLock _lock;
NSMutableDictionary *_dictionary; // Class Cluster!
@mattt
mattt / uiappearance-selector.md
Last active March 19, 2024 12:52
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \