Skip to content

Instantly share code, notes, and snippets.

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

Ekrem TAŞKIRAN perpeer

🏠
Working from home
  • Istanbul
View GitHub Profile
@diogoos
diogoos / SnapCarousel.swift
Last active March 25, 2024 15:40 — forked from xtabbas/SnapCarousel.swift
A carousel that snap items in place built on SwiftUI
//
// CarouselView.swift
//
// Created by xtabbas on 5/7/20.
// Copyright © 2020 xtadevs. All rights reserved.
// Original source available at
// https://gist.github.com/xtabbas/97b44b854e1315384b7d1d5ccce20623
//
// Modified by Diogo Silva on 30/03/21
// Modified source available at
@sindresorhus
sindresorhus / IdentifiableByHashable.swift
Created March 10, 2021 10:30
Make a type `Identifiable` based on its `Hashable` hash value.
/**
Make a type `Identifiable` based on its `Hashable` hash value.
This can be useful when all the properties are required to represent its identifier.
```
struct Item: Hashable, IdentifiableByHashable {
let title: String
var message: String?
}
@marlosirapuan
marlosirapuan / gist:778d6beda5f8ab95695748011c864b19
Last active April 12, 2026 20:18
Download .m3u8 files on MacOS

Install ffmpeg

brew install ffmpeg

Download file through url, like this:

ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "http://url-file.domain.m3u8" -c copy video.mp4
@alsedi
alsedi / gist:64954a98bd44d1b5675002b3781f0954
Created April 5, 2018 15:02
UIView+SizeConstraints.Swift
import Foundation
extension UIView {
func height(constant: CGFloat) {
setConstraint(value: constant, attribute: .height)
}
func width(constant: CGFloat) {
setConstraint(value: constant, attribute: .width)
}
anonymous
anonymous / init.vim
Created January 16, 2018 09:31
call plug#begin()
Plug 'ArunSahadeo/Webval'
Plug 'Valloric/YouCompleteMe'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'chr4/nginx.vim'
Plug 'chrisbra/Colorizer'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'embear/vim-localvimrc'
Plug 'flazz/vim-colorschemes'
Plug 'groenewege/vim-less'
@andreacipriani
andreacipriani / Bash.swift
Last active June 11, 2025 09:19
Execute shell/bash commands from Swift
import UIKit
protocol CommandExecuting {
func run(commandName: String, arguments: [String]) throws -> String
}
enum BashError: Error {
case commandNotFound(name: String)
}
@jlehikoinen
jlehikoinen / setup.sh
Last active February 22, 2026 19:30
Swift syntax highlighting for Vim
# Swift syntax highlighting for Vim
# Source: http://wingsquare.com/blog/swift-script-syntax-highlighting-and-indentation-for-vim-text-editor/
echo "--- Installing and configuring Pathogen.."
mkdir -p ~/.vim/autoload ~/.vim/bundle
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
echo "execute pathogen#infect()
syntax on
import Cocoa
// for-in
func checkForIn(array: [Int], dict: [Int: String]) {
for num in array where dict[num] != nil {
num
}
}
checkForIn([1,2,3,4], dict: [1:"one", 2:"two"])