Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
On vacation

GuangGuang Guang1234567

🌴
On vacation
View GitHub Profile
@lilydjwg
lilydjwg / gh-check
Last active Apr 12, 2021
gh-check: speed test to known GitHub IPs
View gh-check
#!/usr/bin/python3
import asyncio
import time
import socket
import argparse
import aiohttp
class MyConnector(aiohttp.TCPConnector):
@Guang1234567
Guang1234567 / trial.key
Created Feb 13, 2019 — forked from huqi/trial.key
Beyond Compare 4 license for Mac
View trial.key
Beyond Compare 4
Licensed to: ASIO Allsoftinone
Quantity: 1 user
Serial number: 1822-9597
License type: Pro Edition for Windows
--- BEGIN LICENSE KEY ---
H1bJTd2SauPv5Garuaq0Ig43uqq5NJOEw94wxdZTpU-pFB9GmyPk677gJ
vC1Ro6sbAvKR4pVwtxdCfuoZDb6hJ5bVQKqlfihJfSYZt-xVrVU27+0Ja
hFbqTmYskatMTgPyjvv99CF2Te8ec+Ys2SPxyZAF0YwOCNOWmsyqN5y9t
@nishanthvijayan
nishanthvijayan / PipeForward.md
Last active Oct 15, 2020
Simple Pipe forward operator in Kotlin
View PipeForward.md

Here I try to implement a simple pipe forward operator similar to |> operator in Elixir or the andThen operator in Scala

Let's say you have a need for doing something like this

val x = f("something")
val y = g(x)
val z = h(y)

This is also equivalent to saying:

@HiImJulien
HiImJulien / Swift Meets CCxx.md
Last active Feb 18, 2021
This gist is a simple example on how to call a function written in swift from C/C++, without taking the detour via Objective-C/C++.
View Swift Meets CCxx.md

Swift Meets C/C++

This gist is a simple example on how to call a function written in swift from C/C++, without taking the detour via Objective-C/C++.


Analytics

In this example we're going to invoke a function called say_hello, which, as the name already suggests, prints "Hello, World!" to the terminal.

@kakajika
kakajika / ScopeFuncs.swift
Last active Jan 29, 2021
A port of Kotlin's scope functions to Swift.
View ScopeFuncs.swift
protocol ScopeFunc {}
extension ScopeFunc {
@inline(__always) func apply(block: (Self) -> ()) -> Self {
block(self)
return self
}
@inline(__always) func letIt<R>(block: (Self) -> R) -> R {
return block(self)
}
}
@evantoli
evantoli / GitConfigHttpProxy.md
Last active Apr 13, 2021
Configure Git to use a proxy
View GitConfigHttpProxy.md

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@Diolor
Diolor / BroadcastObservable.java
Last active Jan 13, 2021
Retry with Connection
View BroadcastObservable.java
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Looper;
import rx.Observable;
import rx.Scheduler;
@TWiStErRob
TWiStErRob / SquareFrameLayout.java
Created Sep 30, 2015
Make GridView or GridLayoutManager items square.
View SquareFrameLayout.java
package net.twisterrob.android.view;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
public class SquareFrameLayout extends FrameLayout {
public SquareFrameLayout(Context context) {
super(context);
}
@RohanBhanderi
RohanBhanderi / Git_mergetool_commands
Last active Feb 24, 2019
Git Mergetool and difftool with Beyond Compare 4
View Git_mergetool_commands
//Git Mergetool and difftool with Beyond Compare 4
//For Windows
//IF running this command in git bash then escape $ with \
git config --global diff.tool bc4
git config --global difftool.bc4.cmd "\"C:/Program Files (x86)/Beyond Compare 4/BCompare.exe\" \"\$LOCAL\" \"\$REMOTE\""
git config --global difftool.prompt false
git config --global merge.tool bc4
git config --global mergetool.bc4.cmd "\"C:/Program Files (x86)/Beyond Compare 4/BCompare.exe\" \"\$LOCAL\" \"\$REMOTE\" \"\$BASE\" \"\$MERGED\""
git config --global mergetool.bc4.trustExitCode true
@wholmgren
wholmgren / use-bbdiff
Last active Jan 21, 2021
set git difftool to bbdiff
View use-bbdiff
git config --global diff.tool bbdiff
git config --global difftool.bbdiff.cmd 'bbdiff --wait --resume "$LOCAL" "$REMOTE"'
git config --global difftool.prompt false
git config --global merge.tool bbdiff
git config --global mergetool.bbdiff.cmd 'bbdiff --wait --resume "$LOCAL" "$REMOTE"'
Double check ~/.gitconfig