Skip to content

Instantly share code, notes, and snippets.

View theRealGupta's full-sized avatar
:octocat:
Let's start something NEW today. :)

Anup Gupta theRealGupta

:octocat:
Let's start something NEW today. :)
View GitHub Profile
@stefanschmidt
stefanschmidt / toggle-screen-sharing
Last active November 29, 2023 22:21
Enable/Disable Screen Sharing on OSX
# Enable Screen Sharing
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist
# Disable Screen Sharing
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.screensharing.plist
@tempire
tempire / swift_draw_image_on_pdf.swift
Created April 25, 2015 09:24
swift draw image on pdf
func drawOnPDF(path: String) {
// Get existing Pdf reference
let pdf = CGPDFDocumentCreateWithURL(NSURL(fileURLWithPath: path))
// Get page count of pdf, so we can loop through pages and draw them accordingly
let pageCount = CGPDFDocumentGetNumberOfPages(pdf);
// Write to file
UIGraphicsBeginPDFContextToFile(path, CGRectZero, nil)
package main
import (
"database/sql"
"strconv"
"log"
"net/http"
"fmt"
"bytes"
"gopkg.in/gin-gonic/gin.v1"
@joseluisq
joseluisq / export_vscode_extesions.md
Last active May 6, 2024 01:34
How to export your VS Code extensions from terminal

How to export your VS Code extensions from terminal

Note: Unix-like systems only.

  1. Export your extensions to a shell file:
code --list-extensions | sed -e 's/^/code --install-extension /' > my_vscode_extensions.sh
@pietrobasso
pietrobasso / ExtractYouTubeId.playground
Last active October 7, 2020 22:59 — forked from zdk/extract_youtube_id.mm
A Regex to extract YouTube video ids from the given list of youtube URLs in Swift 4
//: Playground - noun: a place where people can play
//
// Created by Pietro Basso on 29/06/2018.
// Copyright (c) 2018 Pietro Basso. All rights reserved.
//
let urls = ["http://youtu.be/NLqAF9hrVbY",
"http://www.youtube.com/watch?feature=player_embedded&v=DJjDrajmbIQ",
"http://www.youtube.com/watch?v=dQw4w9WgXcQ",
"http://www.youtube.com/embed/NLqAF9hrVbY",
@theRealGupta
theRealGupta / ExtractYouTubeId.playground
Created January 21, 2019 07:32 — forked from pietrobasso/ExtractYouTubeId.playground
A Regex to extract YouTube video ids from the given list of youtube URLs in Swift 4
//: Playground - noun: a place where people can play
//
// Created by Pietro Basso on 29/06/2018.
// Copyright (c) 2018 Pietro Basso. All rights reserved.
//
let urls = ["http://youtu.be/NLqAF9hrVbY",
"http://www.youtube.com/watch?feature=player_embedded&v=DJjDrajmbIQ",
"http://www.youtube.com/watch?v=dQw4w9WgXcQ",
"http://www.youtube.com/embed/NLqAF9hrVbY",
@rdelrosario
rdelrosario / app_notarizer.sh
Last active January 12, 2024 19:40
macOS Application Notarization Script
#!/bin/bash
usage()
{
# Display Help
echo "*********************************************************************************************************************************************************"
echo " MacOS Application Notarization Script"
echo "*********************************************************************************************************************************************************"
echo
@rdelrosario
rdelrosario / App.entitlements
Created May 28, 2020 21:24
macOS Application App Entitlements
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<false/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>