Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am omarkth on github.
  • I am omarhattab (https://keybase.io/omarhattab) on keybase.
  • I have a public key ASBQcaXvp0I1VnARF15nnMix-4YTy7Ed0o3hCb9rEv77iwo

To claim this, I am signing this object:

@Omarkth
Omarkth / Mac OS X: Open in Visual Studio Code
Created March 6, 2019 13:32 — forked from tonysneed/Mac OS X: Open in Visual Studio Code
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"
@Omarkth
Omarkth / apns.sh
Created January 29, 2019 12:37 — forked from greencoder/apns.sh
Curl the APNS http/2 API
# Note: You MUST have curl 7.47+ with http/2 support compiled in
curl -v \
-d '{"aps":{"alert":"<message>","badge":42}}' \
-H "apns-topic: <bundle id>" \
-H "apns-priority: 10" \
--http2 \
--cert <certificate file> \
https://api.development.push.apple.com/3/device/<device token>
@Omarkth
Omarkth / gist:ee0cd5b3ada38db92ab628582a361335
Created January 29, 2019 12:36 — forked from kublaios/gist:f01cdf4369c86ddd6d71
Making a PEM File for iOS Push Notifications (From Ray Wenderlich's tutorial)
# Convert the .cer file into a .pem file:
$ openssl x509 -in aps_development.cer -inform der -out PushChatCert.pem
# Convert the private key’s .p12 file into a .pem file:
$ openssl pkcs12 -nocerts -in PushChatKey.p12 -out PushChatKey.pem
# Finally, combine the certificate and key into a single .pem file
$ cat PushChatCert.pem PushChatKey.pem > ck.pem
# At this point it’s a good idea to test whether the certificate works.
https://stackoverflow.com/a/26552740/169067
git clone --mirror <URL to my OLD repo location>
cd <New directory where your OLD repo was cloned>
git remote set-url origin <URL to my NEW repo location>
git push -f origin
@Omarkth
Omarkth / MachineKeyHelper.cs
Last active December 28, 2017 15:17
GenerateMachineKey
using System;
using System.Text;
using System.Security.Cryptography;
public class Program
{
public static void Main()
{
// set LENGTH to 128 to generate [ValidationKey] and 64 to generate [DecryptionKey]
int len = 128;