Skip to content

Instantly share code, notes, and snippets.

@danieldogeanu
danieldogeanu / MakePowerShellRememberSSHPassphrase.md
Last active April 18, 2024 08:13
How to make Powershell remember the SSH key passphrase.

You should not use the Open SSH client that comes with Git for Windows. Instead, Windows 10 has its own implementation of Open SSH that is integrated with the system. To achieve this:

  1. Start the ssh-agent from Windows Services:
  • Type Services in the Start Menu or Win+R and then type services.msc to launch the Services window;
  • Find the OpenSSH Authentication Agent in the list and double click on it;
  • In the OpenSSH Authentication Agent Properties window that appears, choose Automatic from the Startup type: dropdown and click Start from Service status:. Make sure it now says Service status: Running.
  1. Configure Git to use the Windows 10 implementation of OpenSSH by issuing the following command in Powershell:
git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int PostMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::PostMessage(-1,0x0112,0xF170,2)
@wayanjimmy
wayanjimmy / install_php71.sh
Last active October 2, 2019 14:28
Install php7.1 ubuntu 16.04 EC2
sudo apt-get update -y
sudo apt-get install -y nginx
sudo apt-get install -y python-software-properties
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update -y
sudo apt-get install -y php7.1 php7.1-fpm php7.1-cli php7.1-common php7.1-mbstring php7.1-gd php7.1-intl php7.1-xml php7.1-mysql php7.1-mcrypt php7.1-zip
sudo apt-get install php-curl
@churro-s
churro-s / LetsEncrypt_HTTPS_plex.MD
Last active February 25, 2024 11:52
Setup Let's Encrypt certificate for use with Plex Media Server on Ubuntu
@catindev
catindev / regex-camelCase-to-dash.js
Created June 12, 2016 20:09 — forked from youssman/regex-camelCase-to-dash.js
Javascript convert camelcase to dash (hyphen)
function camelCaseToDash( myStr ) {
return myStr.replace( /([a-z])([A-Z])/g, '$1-$2' ).toLowerCase();
}
var myStr = camelCaseToDash( 'thisString' );
alert( myStr ); // => this-string
@gabu
gabu / gist:fa671ae685413baebab9
Created August 6, 2014 12:53
CMTimeMake vs CMTimeMakeWithSeconds
NSLog(@"%f", CMTimeGetSeconds(CMTimeMake(3.25, 1))); // 3.000000
NSLog(@"%f", CMTimeGetSeconds(CMTimeMake(3.25 * 100, 100))); // 3.250000
NSLog(@"%f", CMTimeGetSeconds(CMTimeMakeWithSeconds(3.25, 1))); // 3.000000
@btjones
btjones / SimpleKeychain.h
Created April 9, 2014 16:12
An updated version of SimpleKeychain (original: http://stackoverflow.com/a/5251820/334725) that supports accounts
#import <Foundation/Foundation.h>
@class SimpleKeychainUserPass;
@interface SimpleKeychain : NSObject
+ (void)save:(NSString *)service account:(NSString *)account data:(id)data;
+ (id)load:(NSString *)service account:(NSString *)account;
+ (void)delete:(NSString *)service account:(NSString *)account;
@bunnyhero
bunnyhero / ReusableCellExample.m
Last active February 19, 2022 02:04
Example of Reactive Cocoa binding for a reusable cell.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell =
[tableView dequeueReusableCellWithIdentifier:REUSABLE_CELL_ID];
UILabel *label = (UILabel *)[cell viewWithTag:VIEW_TAG];
Model *someModel = [self getModelFromIndexPath:indexPath];
// `takeUntil:` makes the RACObserve() signal complete (and thus breaks the subscription)
// when the cell is recycled.
@nuthatch
nuthatch / NSManagedObject+Serialization.h
Last active May 8, 2019 11:25 — forked from pkclsoft/NSManagedObject+Serialization.h
Fixes for Peter Easdown's category 1. don't assume each Entity name matches the Class name. 2. strip DATE_ATTR_PREFIX when deserializing dates back into NSManagedObject 3. add support for NSOrderedSet 4. use set to keep traversal history, and allow classes to opt-out with serializationObjectsToSkip
@interface NSManagedObject (Serialization)
- (NSDictionary*) toDictionary;
- (void) populateFromDictionary:(NSDictionary*)dict;
+ (NSManagedObject*) createManagedObjectFromDictionary:(NSDictionary*)dict
inContext:(NSManagedObjectContext*)context;
@end
@cmsj
cmsj / gist:4694242
Created February 1, 2013 21:23
My current lcd4linux configuration. For more details of some of the python stuff here, and some preview videos, see: http://www.tenshu.net/2013/01/funky-lcd4linux-python-module.html
# lcd4linux config
## Local config
Variables {
# This are useful substitutions for later
tick 500
tack 100
seconds 2000
net_if 'br0' # Set this to the network interface to monitor