Skip to content

Instantly share code, notes, and snippets.

@nursarowar
nursarowar / A-half-hour-to-learn-Zig.md
Created July 18, 2022 18:02 — forked from ityonemo/test.md
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@nursarowar
nursarowar / install-zsh-windows-git-bash.md
Created May 26, 2022 12:04 — forked from fworks/install-zsh-windows-git-bash.md
Zsh / Oh-my-zsh on Windows Git Bash
@nursarowar
nursarowar / next-ssr-recoil.js
Created February 7, 2022 14:23 — forked from spro/next-ssr-recoil.js
Attempt at SSR with Recoil - setting initial atom values with Next.js getServerSideProps
import {useEffect} from 'react'
import {RecoilRoot, useRecoilState, atom} from 'recoil'
// User data
const user1 = {username: 'joe', bio: "You will never see me, unless of course this example is totally broken."}
const user2 = {username: 'bob', bio: "I am the one true user."}
const user3 = {username: 'fred', bio: "Just kidding, make way for the new guy."}
// Recoil atom to store user. The default user is user1, but it will be
@nursarowar
nursarowar / windscribe-ikev2.txt
Created November 22, 2019 13:25 — forked from prajaybasu/windscribe-ikev2.txt
Add all WS VPNs to Windows 10. Have both files in the same folder
us-central.windscribe.com,US Central
us-east.windscribe.com,US East
us-west.windscribe.com,US West
wf-us.windscribe.com,WINDFLIX US
ca.windscribe.com,Canada East
ca-west.windscribe.com,Canada West
wf-ca.windscribe.com,WINDFLIX CA
at.windscribe.com,Austria
be.windscribe.com,Belgium
bg.windscribe.com,Bulgaria
@nursarowar
nursarowar / macapp.go
Created November 20, 2018 05:20 — forked from mholt/macapp.go
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use:
@nursarowar
nursarowar / config.ovpn
Created September 20, 2018 15:15 — forked from ericbaranowski/config.ovpn
OpenVPN command line options nicely formatted for building your custom config file
OpenVPN 2.4.3 x86_64-apple-darwin16.6.0 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [MH/RECVDA] [AEAD] built on Jun 21 2017
# Local host name or ip address.
# Implies --bind.
local <hostname>
# Remote host name or ip address.
remote <hostname> [port]
# If multiple --remote options specified, choose one randomly.
@nursarowar
nursarowar / drop_encrypt.go
Created March 4, 2018 08:48 — forked from josephspurrier/drop_encrypt.go
Golang - Drag and Drop AES Encryption and Decryption
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"fmt"
"io"
"io/ioutil"
"os"
@nursarowar
nursarowar / README.md
Created December 8, 2017 14:33 — forked from eliquious/README.md
Golang OpenPGP examples

Building

go build -o goencrypt main.go

Generating Keys

@nursarowar
nursarowar / deviceToken.m
Created May 27, 2017 13:51 — forked from phynet/deviceToken.m
Get iOS device token for push notification
NSString *token = [[deviceToken description] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:@"<>"]];
token = [token stringByReplacingOccurrencesOfString:@" " withString:@""];
NSLog(@"Device Token %@: ", token);
@nursarowar
nursarowar / 1.README
Created May 27, 2017 13:36
(iOS) Server Push Notifications
The architecture of Push Notification consists of three key pieces:
1. iOS Application – that enables push notification and registers the device for notification
2. Application Server – is responsible for generating the messages and publishing them to the Apple Push Notification Service (APNS)
3.Apple Push Notification Service (APNS) – is responsible for delivering the messages to the devices where the application is installed
HOW TO GET a PUSH CERTIFICATION
http://b2cloud.com.au/how-to-guides/ios-push-notifications-in-php