Skip to content

Instantly share code, notes, and snippets.

View vdeep's full-sized avatar
🎯
Focusing

Vishal Kanojia vdeep

🎯
Focusing
  • Punjab, India
View GitHub Profile
@patriknyblad
patriknyblad / xcrun_simctl_cheatsheet.md
Last active June 18, 2024 23:44
iOS Simulator Terminal Commands `$ xcrun simctl`

Managing iOS Simulators

List all simulators created

$ xcrun simctl list --json

Delete old and unavailable simulators

$ xcrun simctl delete unavailable
@paolocarrasco
paolocarrasco / README.md
Last active June 7, 2024 22:59
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@eugenebokhan
eugenebokhan / CGImage+Resize.swift
Last active April 11, 2024 21:28
UIImage + Resize
import CoreGraphics
import Accelerate
import CoreImage
import UIKit
extension CGImage {
public enum Error: Swift.Error {
case imageResizingFailed
case cgContextCreationFailed
@marcosgriselli
marcosgriselli / UIImage+Resize.swift
Last active February 2, 2024 07:04
UIImage Resize/Scaling
//
// UIImage+Resize.swift
//
// Created by Marcos Griselli on 6/9/17.
// Copyright © 2017 Marcos Griselli. All rights reserved.
//
import Foundation
import UIKit
@vinhnx
vinhnx / uicollectionview+fade.md
Last active February 24, 2022 18:58
Collection view cell fade as scrolling effect

// reference: https://stackoverflow.com/a/42705208/1477298

You can do a lot of fun stuff to collection views. I like to subclass UICollectionViewFlowLayout. Here is an example that fades the top and the bottom of the collection view based on distance from center. I could modify it to fade only the very edges but you should figure it after you look through the code.

import UIKit

class FadingLayout: UICollectionViewFlowLayout,UICollectionViewDelegateFlowLayout {

    //should be 0<fade<1
@guanting112
guanting112 / install_source_command_line_tools.sh
Last active May 9, 2023 13:52
[macOS] SourceTree command line tools install script ( support 10.11, 10.12 )
#!/usr/bin/env bash
function link_stree {
ln -s /Applications/SourceTree.app/Contents/Resources/stree /usr/local/bin/
}
function install {
link_stree
}
@dersam
dersam / gitkraken.zsh
Last active May 28, 2024 22:14
Open GitKraken using the current repo directory in the cli.
## Open GitKraken using the current repo directory.
## For when you want a prettier view of your current repo,
## but prefer staying in the cli for most things.
## This will break if GitKraken ever removes the -p flag.
## If you're not using OSX, the path is definitely different.
kraken () {
~/Applications/GitKraken.app/Contents/MacOS/GitKraken -p $(pwd)
}
@wayanjimmy
wayanjimmy / AuthServiceProvider.php
Last active January 4, 2024 09:32
Extend Laravel SessionGuard
<?php
namespace App\Providers;
use App\Extensions\SessionAnonymousGuard;
use Illuminate\Auth\SessionGuard;
use Illuminate\Contracts\Auth\Access\Gate as GateContract;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
@gonzalezreal
gonzalezreal / ios-cell-registration-swift.md
Last active March 13, 2024 15:18
iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics

iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics

A common task when developing iOS apps is to register custom cell subclasses for both UITableView and UICollectionView. Well, that is if you don’t use Storyboards, of course.

Both UITableView and UICollectionView offer a similar API to register custom cell classes:

public func registerClass(cellClass: AnyClass?, forCellWithReuseIdentifier identifier: String)
public func registerNib(nib: UINib?, forCellWithReuseIdentifier identifier: String)
@ossanna16
ossanna16 / Beginner-friendly Python Open Source Projects
Last active February 5, 2024 09:46
This is a list of beginner-friendly Python open source projects. I'm always looking for new projects to add to my list, if you have an idea please tweet me at @ossanna16 :)
* OpenHatch - https://openhatch.org/search/?q=&language=Python
* PyLadies - https://github.com/pyladies
* New Coder - https://github.com/econchick/new-coder
* Django Girls - https://github.com/DjangoGirls
* Matplotlib - https://github.com/matplotlib/matplotlib
* Hylang - http://docs.hylang.org/en/latest/, https://github.com/hylang/hy
* Open Slides (Django) - http://openslides.org/
* Zeeguu - https://zeeguu.unibe.ch
* Project Jupyter - https://github.com/jupyter
* nbgrader - https://github.com/jupyter/nbgrader