Skip to content

Instantly share code, notes, and snippets.

View mtshare's full-sized avatar
🎯
Focusing

Marco mtshare

🎯
Focusing
View GitHub Profile
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@iMokhles
iMokhles / CFPreferencesAppSynchronize with ARC and non ARC.xm
Last active August 16, 2020 13:28
How to use CFPreferencesAppSynchronize with ARC and non ARC (iOS8 Tweaks) + CFNotificationCallback (option) Works fine with Sandbox Apps
static BOOL tweakEnBOOL;
#define SETTINGSFILENEW "com.imokhles.Prefs"
#define PREFERENCES_CHANGED_NOTIFICATION "com.imokhles.Prefs.preferences-changed"
// non ARC
static void iMoLoadPreferences() {
CFPreferencesAppSynchronize(CFSTR(SETTINGSFILENEW));
tweakEnBOOL = !CFPreferencesCopyAppValue(CFSTR("Enabled"), CFSTR(SETTINGSFILENEW)) ? YES : [(id)CFBridgingRelease(CFPreferencesCopyAppValue(CFSTR("Enabled"), CFSTR(SETTINGSFILENEW))) boolValue];
}
@balupton
balupton / README.md
Last active October 21, 2022 06:55
Boot Camp / Dual Boot on an iMac 27" Mid 2011

Dual Booting on an iMac 27" Mid 2011

UPDATE: See comment section below this post.

This guide is so complicated because the iMac's 27" Mid 2011 SuperDrive doesn't recognise the windows install disc. It's useless.

IMPORTANT: Unplug all external and physical hard drives (where possible) that you won't be installing to to avoid accidentally erasing them. Also make note of which drives and partitions remain (e.g. System and Storage hard drives), and be super careful to not erase the wrong one.

RECOVERY: If you nuke your machine, restore your time machine backup. Instructions here.

@matej
matej / UIAlertView+Blocks.h
Created November 7, 2012 13:49
UIAlertView with blocks support
//
// UIAlertView+Blocks.h
//
// Created by Matej Bukovinski on 19.7.11.
// Copyright 2011 Guerrilla Code. All rights reserved.
//
#import <Foundation/Foundation.h>
@ichitaso
ichitaso / install_theos.sh
Last active August 6, 2016 00:15 — forked from r-plus/install_theos.sh
Theos install script
#!/bin/bash
export THEOS=/opt/theos
if ! [ -d $THEOS ]; then
mkdir -p $THEOS
fi
# clone theos.git
cd /opt
git clone git://github.com/DHowett/theos.git
@leovandriel
leovandriel / gist:3794804
Created September 27, 2012 15:59
NWURLConnection - an NSURLConnectionDelegate based on blocks with cancel
// NWURLConnection - an NSURLConnectionDelegate based on blocks with cancel.
// Similar to the `sendAsynchronousRequest:` method of NSURLConnection, but
// with `cancel` method. Requires ARC on iOS 6 or Mac OS X 10.8.
// License: BSD
// Author: Leonard van Driel, 2012
@interface NWURLConnection : NSObject<NSURLConnectionDelegate>
@property (nonatomic, strong) NSURLRequest *request;
@property (nonatomic, strong) NSOperationQueue *queue;
@conradev
conradev / cydia_report.py
Created May 19, 2012 17:07
Cydia Store Daily Report
#!/usr/bin/python
import string, time, calendar, hashlib, urllib2, smtplib
from email.mime.text import MIMEText
# Cydia globals
product_ids = ['org.thebigboss.somepackage', 'org.thebigboss.someotherpackage']
splits = [ 0.70, 0.35 ]
vendor_id = ""
vendor_secret = ""
nic 1
prompt TARGET "BulletinBoard Provider Display Identifier" "com.apple.mobilesafari"
dir BulletinBoard
dir layout
dir layout/Library
dir layout/Library/WeeLoader
dir layout/Library/WeeLoader/BulletinBoardPlugins
dir layout/Library/WeeLoader/BulletinBoardPlugins/@@PROJECTNAME@@.bundle
file 366 BulletinBoard/BulletinBoard.h
#import <Foundation/Foundation.h>
@Sakurina
Sakurina / slaveplay.m
Created June 18, 2011 15:56
an example for @r_plus
-(void) setMasterToggle:(id)value specifier:(id)specifier {
// You'd set the "set" property for your switch in your plist to
// "setMasterToggle:specifier:" so this gets called
[self setPreferenceValue:value specifier:specifier];
BOOL boolValue = [value boolValue];
// "SlaveToggle" is the ID of the toggle that depends on this switch
PSSpecifier* slaveSpecifier = [self specifierForID:@"SlaveToggle"];