Skip to content

Instantly share code, notes, and snippets.

View lukaspechar's full-sized avatar
💻
Coding...

Lukáš Pechar lukaspechar

💻
Coding...
  • Prague, Czech Republic | Malta
View GitHub Profile
@alexjlockwood
alexjlockwood / androidx-class-mapping.csv
Last active March 10, 2024 21:08
Android X migration script
android.support.v7.widget.util.SortedListAdapterCallback androidx.recyclerview.widget.SortedListAdapterCallback
android.support.v7.widget.helper.ItemTouchUIUtilImpl androidx.recyclerview.widget.ItemTouchUIUtilImpl
android.support.v7.widget.helper.ItemTouchUIUtil androidx.recyclerview.widget.ItemTouchUIUtil
android.support.v7.widget.helper.ItemTouchHelper androidx.recyclerview.widget.ItemTouchHelper
android.support.v7.widget.WithHint androidx.appcompat.widget.WithHint
android.support.v7.widget.ViewUtils androidx.appcompat.widget.ViewUtils
android.support.v7.widget.ViewStubCompat androidx.appcompat.widget.ViewStubCompat
android.support.v7.widget.ViewInfoStore androidx.recyclerview.widget.ViewInfoStore
android.support.v7.widget.ViewBoundsCheck androidx.recyclerview.widget.ViewBoundsCheck
android.support.v7.widget.VectorEnabledTintResources androidx.appcompat.widget.VectorEnabledTintResources
@bradtraversy
bradtraversy / docker-help.md
Last active July 9, 2024 10:18
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@bszwej
bszwej / echo.js
Last active July 14, 2024 03:28
Pure Node.js echo server, that logs all incoming http requests (method, path, headers, body).
const http = require('http');
const server = http.createServer();
server.on('request', (request, response) => {
let body = [];
request.on('data', (chunk) => {
body.push(chunk);
}).on('end', () => {
body = Buffer.concat(body).toString();
import Foundation
import UIKit
// Usage Examples
let shadowColor = Color.shadow.value
let shadowColorWithAlpha = Color.shadow.withAlpha(0.5)
let customColorWithAlpha = Color.custom(hexString: "#123edd", alpha: 0.25).value
enum Color {
@schickling
schickling / UIImageFixedOrientationExtension.swift
Last active February 4, 2024 15:00
Extension to fix orientation of an UIImage (Sets orientation to portrait)
extension UIImage {
func fixedOrientation() -> UIImage {
if imageOrientation == UIImageOrientation.Up {
return self
}
var transform: CGAffineTransform = CGAffineTransformIdentity
@gitaarik
gitaarik / git_submodules.md
Last active July 23, 2024 12:21
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
- (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity
{
CGFloat offSetAdjustment = MAXFLOAT;
CGFloat horizontalCenter = (CGFloat) (proposedContentOffset.x + (self.collectionView.bounds.size.width / 2.0));
CGRect targetRect = CGRectMake(proposedContentOffset.x, 0.0, self.collectionView.bounds.size.width, self.collectionView.bounds.size.height);
NSArray *array = [self layoutAttributesForElementsInRect:targetRect];
for (UICollectionViewLayoutAttributes *layoutAttributes in array)
{
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active July 22, 2024 12:48
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@NachoMan
NachoMan / DataManager.h
Created April 15, 2011 21:15
Core Data singleton manager class capable of being run from a static library
// DataManager.h
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
extern NSString * const DataManagerDidSaveNotification;
extern NSString * const DataManagerDidSaveFailedNotification;
@interface DataManager : NSObject {
}