Skip to content

Instantly share code, notes, and snippets.

View jahan-paisley's full-sized avatar
🌠
Working on lovely stuff

Jahan Zinedine jahan-paisley

🌠
Working on lovely stuff
View GitHub Profile
@MartinBrugnara
MartinBrugnara / doc.txt
Last active June 14, 2024 16:53
DigitalOcean, assign public ipv6 to wireguard clients
# /etc/sysctl.d/wireguard.conf
net.ipv4.ip_forward=1
net.ipv6.conf.all.forwarding=1
net.ipv6.conf.default.forwarding=1
net.ipv6.conf.eth0.proxy_ndp=1
#/etc/wireguard/wg0.conf (DO virtual machine)
[Interface]
# The server interface does not actually need an ipv6.
# The 2 following must be repeated for each used addres [0, 1]
@kiwiandroiddev
kiwiandroiddev / CartesianProduct.kt
Created August 23, 2019 01:58
Kotlin function to return the cartesian product of two collections
/**
* E.g.
* cartesianProduct(listOf(1, 2, 3), listOf(true, false)) returns
* [(1, true), (1, false), (2, true), (2, false), (3, true), (3, false)]
*/
fun <T, U> cartesianProduct(c1: Collection<T>, c2: Collection<U>): List<Pair<T, U>> {
return c1.flatMap { lhsElem -> c2.map { rhsElem -> lhsElem to rhsElem } }
}
@koenrh
koenrh / proxify-vmware-fusion-vm.md
Created July 8, 2019 15:41
This is a little guide that helps you to "proxify" a VMware Fusion virtual machine on macOS. This can be useful if you want to isolate and analyse web traffic to/from an application by running it in a VM.

Proxifying a VMware Fusion virtual machine on macOS

This is a little guide that helps you to "proxify" a VMware Fusion virtual machine on macOS. This can be useful if you want to isolate and analyse web traffic to/from an application by running it in a VM.

Prerequisites

  • VMware Fusion 11 Pro
  • Transparent HTTP/HTTPS proxy (e.g. Burp Suite Pro or mitmproxy)
@kurokuru
kurokuru / Request.cs
Created May 16, 2019 13:51
GAEにUnityWebRequestでgzipする
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
using Ionic.Zlib;
public class WebRequest : MonoBehaviour
{
// Start is called before the first frame update
IEnumerator Start()
@norio-nomura
norio-nomura / Setup transparent proxy with VMware Fusion.md
Last active April 3, 2023 06:59
Setup transparent proxy with VMware Fusion

Setup transparent proxy with VMware Fusion

  1. Add network (vmnet3) to VMware Fusion
    1. sudo vi /Library/Preferences/VMware\ Fusion/networking
       answer VNET_1_HOSTONLY_SUBNET 172.16.92.0
       answer VNET_1_VIRTUAL_ADAPTER yes
       answer VNET_1_VIRTUAL_ADAPTER_ADDR 172.16.92.1
      +answer VNET_3_DHCP yes
      +answer VNET_3_DHCP_PARAM_DNS_ADDR 172.16.12.1
      +answer VNET_3_DHCP_PARAM_ROUTERS 172.16.12.1

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@psayre23
psayre23 / gist:c30a821239f4818b0709
Last active September 7, 2024 01:52
Runtime Complexity of Java Collections
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
@bzerangue
bzerangue / _verify-repair-permissions-disk.md
Last active September 2, 2024 16:33
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@nissoh
nissoh / ng-grid-rtl.js
Last active January 4, 2016 11:09
ng-grid rtl
/***********************************************
* ng-grid JavaScript Library
* Authors: https://github.com/angular-ui/ng-grid/blob/master/README.md
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
* Compiled At: 07/06/2013 13:50
***********************************************/
(function(window, $) {
'use strict';
// the # of rows we want to add to the top and bottom of the rendered grid rows
var EXCESS_ROWS = 6;