Sometimes GitHub will mismark your repo's languages.
I had a C++ project displaying that a large portion was Objective-C because of a single header file from SQLite3.h
.
Create a .gitattributes
file in your root.
Mine looks like this:
""" | |
Author: Jonathan Cardasis | |
""" | |
import socket | |
import signal # Allow socket destruction on Ctrl+C | |
import sys | |
import time | |
import threading |
func measureBlock(_ description: String, numberOfExecutes: Int = 1, block: () -> Void) { | |
let start = DispatchTime.now() | |
for _ in 0..<numberOfExecutes { | |
block() | |
} | |
let end = DispatchTime.now() | |
let nanoTime = end.uptimeNanoseconds - start.uptimeNanoseconds | |
let secondsTime = (Double(nanoTime)/1000000000.0) |
This will rewrite the branch's commit history and is useful for combining users if two emails were used for a single user at any point.
Note: Since this edits all history, everyone will need to re-clone the repo in order to get the correct history on their local machines.
A list of users who committed can be viewed via git shortlog -s -n
.
$ git filter-branch --commit-filter '
if [ "$GIT_AUTHOR_EMAIL" = "jonViaDesktop@localhost" ];
then
#!/bin/sh | |
# Sets an icon for a file | |
# Parameters: | |
# $1 icon_source - file path to the icon soruce (a .icns file) | |
# $2 file_path - file path the the destination file to change the icon of | |
icon_source=$1 | |
file_path=$2 | |
generated_icon=".icon.rsrc" |
let cornerAnimation = CABasicAnimation(keyPath: #keyPath(CALayer.cornerRadius)) | |
cornerAnimation.fromValue = oldValue | |
cornerAnimation.toValue = newValue | |
cornerAnimation.duration = 1.0 | |
styledButton.layer.cornerRadius = newValue | |
styledButton.layer.add(cornerAnimation, forKey: #keyPath(CALayer.cornerRadius)) |
CATransaction.begin() | |
CATransaction.setAnimationDuration(0.5) | |
styledButton.layer.opacity = 0.5 | |
styledButton.layer.backgroundColor = UIColor.white.cgColor | |
CATransaction.commit() |
let oldValue = styledButton.frame.width/2 | |
let newButtonWidth: CGFloat = 60 | |
/* Do Animations */ | |
CATransaction.begin() | |
CATransaction.setAnimationDuration(2.0) | |
CATransaction.setAnimationTimingFunction(CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)) | |
// View animations | |
UIView.animate(withDuration: 2.0) { |
let timingFunction = CAMediaTimingFunction(controlPoints: 0.65, -0.55, 0.27, 1.55) | |
//... | |
CATransaction.setAnimationTimingFunction(timingFunction) | |
//... Do your UIKit animation |
UIView.animate(withDuration: 1.0) { | |
self.button.frame = CGRect(x: 0, y: 0, width: 100, height: 100) | |
} |