Skip to content

Instantly share code, notes, and snippets.

View rshev's full-sized avatar

Roman Shevtsov rshev

View GitHub Profile
@smileart
smileart / README.md
Last active March 16, 2024 15:42 — forked from agnoster/README.md
My ZSH Theme — Agnoster Mod

My modified fork of agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

Compatibility

@sgergely
sgergely / gist:3793166
Created September 27, 2012 09:43
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@eric-hu
eric-hu / Open iterm tab here
Last active March 11, 2022 02:45
Apple script to open an iterm2 tab from right-clicking on a file or folder in Finder. To use: (1) Open Automator (2) Create a new service (3) Change "Service receives selected" drop downs to "Files or folders" in "Finder" (4) Select "Run applescript" from the sidebar, then paste this script in and save
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
--
-- Modified to work with files as well, cd-ing to their container folder
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set filetype to (kind of (info for my_file))
-- Treats OS X applications as files. To treat them as folders, integrate this SO answer:
@cristianca
cristianca / Create color with gradient
Last active April 14, 2023 18:25
Create a gradient UIColor from an array of colors.
func colorWithGradient(frame: CGRect, colors: [UIColor]) -> UIColor {
// create the background layer that will hold the gradient
let backgroundGradientLayer = CAGradientLayer()
backgroundGradientLayer.frame = frame
// we create an array of CG colors from out UIColor array
let cgColors = colors.map({$0.CGColor})
backgroundGradientLayer.colors = cgColors
@spinxz
spinxz / ddclient.conf
Created June 20, 2015 15:52
ddclient configuration file with support for upnp compatible routers or modems (e.g. Huawei HiLink modem)
# Configuration file for ddclient
#
# /etc/ddclient.conf
#
# ddclient configuration for servers behind a UPNP compatible NAT router or modem
#
# 1. Install ddclient, ssl support and upnpclient : sudo apt-get install ddclient libio-socket-ssl-perl miniupnpc
# 2. Copy this configuration file to /etc/ddclient.conf
# 3. Adapt the configuration below (especially the <...> fields)
#!/bin/sh -x ## or just ` curl -Ls http://git.io/vRozn | sh `.
## Downloads the Mac OS X 10.10 Recovery Partition update,
## Copy's over the 10.10 version of Disk Utility.app, then
## use git to apply a binary patch so it will run on 10.11+.
cd /tmp
rm -rf DU1010
mkdir DU1010
@sbingner
sbingner / startSSL.pl
Last active April 28, 2016 11:31
StartSSL Certificate Creation
#!/usr/bin/perl
# USAGE: startSSL.pl DOMAIN1 DOMAIN2 ...
#
# Requires:
# - client.crt and client.key in same directory as startSSL.pl
# - DOMAIN.csr in the current directory for each domain (in PEM format)
#
# Outputs: DOMAIN.crt to current directory in PEM format
#
@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)

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@keith
keith / link.sh
Last active December 22, 2016 13:35
Build to iOS 10 from Xcode 7.3.1