Skip to content

Instantly share code, notes, and snippets.

@danieldogeanu
danieldogeanu / MakePowerShellRememberSSHPassphrase.md
Last active April 23, 2024 12:18
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)
@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
@uliluckas
uliluckas / gist:3129990
Created July 17, 2012 15:12
mergeChangesFromContextDidSaveNotification with core data bug workarounds
// See http://lists.apple.com/archives/cocoa-dev/2008/Jun/msg00237.html for bugs below
- (void)mergeChangesFromContextDidSaveNotification:(NSNotification*)notification {
NSManagedObject *object;
NSSet* updates;
// Workaround bug 5982319
// Fault in all updated objects because chnages to faults won't trigger fetchedResultsControlle
updates = [notification.userInfo objectForKey:NSUpdatedObjectsKey];
for (object in updates) {
[[self.roManagedObjectContext objectWithID:[object objectID]] willAccessValueForKey:nil];
@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.
@shimondoodkin
shimondoodkin / APPNAME
Created July 2, 2011 17:33 — forked from peterhost/node_debian_init.sh
init.d script for node.js for debian
#! /bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
@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
@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
@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
@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;