Skip to content

Instantly share code, notes, and snippets.

View enginespot's full-sized avatar
🏠
Working from home

Hongde Liu enginespot

🏠
Working from home
View GitHub Profile
@anttisalonen
anttisalonen / main.rs
Created October 7, 2018 20:52
yew + websocket echo client
#[macro_use]
extern crate yew;
extern crate failure;
use failure::Error;
use yew::prelude::*;
use yew::format::Json;
use yew::services::ConsoleService;
use yew::services::websocket::{WebSocketService, WebSocketStatus, WebSocketTask};
@zchee
zchee / cgo.md
Last active July 14, 2024 14:58
cgo convert list

See also, http://libraryofalexandria.io/cgo/

Using Go cgo

cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.

So, Here collect materials.

@trevorlinton
trevorlinton / node_in_osx_main.mm
Last active February 19, 2020 19:01
Integrating node's event loop safely into CFRunLoop OSX (uvcf goes to 100% cpu after App run)
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#include "node.h"
#include "v8_typed_array.h"
#include "CoreFoundation/CoreFoundation.h"
static int init_argc;
static char **init_argv;
@interface AppDelegate : NSObject <NSApplicationDelegate>
@stephanetimmermans
stephanetimmermans / ubuntu-idea-launcher
Last active June 19, 2016 20:04
Add IntelliJ IDEA Launcher in Ubuntu 14.04
#In IDEA, go to Tools > Create Desktop Entry to create a launcher in /usr/share/applications.
cp /usr/share/applications/jetbrains-idea.desktop ~/.local/share/applications/
#http://nufailm.blogspot.be/2012/05/custom-launcher-for-intellij-idea-in.html
#http://stackoverflow.com/questions/14424254/intellij-launcher-doesnt-work-on-unity
@jeremiahsnapp
jeremiahsnapp / MITM -SSL-Proxies.md
Last active November 14, 2023 07:48
Man In The Middle (MITM) SSL Proxies - Simple ways to see traffic between an SSL server and client in clear text.

HTTP(S) specific MITM SSL Proxies

mitmproxy

mitmproxy is an excellent console app written in Python.

It is easy to use on Linux and OS X.

Use brew install mitmproxy to install it on OS X.

@apaprocki
apaprocki / issue5564.cc
Last active December 17, 2015 20:59
Using libuv to create a loop which uses `UV_RUN_ONCE` to handle either a single timer firing or async send. If the timeout for the timer is 0ms, only one `UV_RUN_ONCE` is needed, but if the timeout is > 0ms, a second `UV_RUN_ONCE` call is needed or the timer callback does not fire.
// Compiling from toplevel of built node.js repo on OSX:
// CC -g -o issue5564 issue5564.cc -I deps/uv/include/ \
// -L out/Debug/ -luv -framework CoreFoundation -framework Carbon
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include "uv.h"
@tkellogg
tkellogg / gist:5619461
Created May 21, 2013 12:33
How I installed mono 3 and monodevelop 4 on Ubuntu 13.04 with NuGet and F# support
# Add this line to your software sources
deb http://debian.meebey.net/experimental/mono /
sudo apt-get update
# of course, apt-get remove mono-complete first...
sudo apt-get install mono-complete
# I installed monodevelop from apt just to get all the prereqs
sudo apt-get install monodevelop
@rdebeasi
rdebeasi / grid-no-gutter.less
Last active December 16, 2015 13:48
This tweak allows you to remove gutters from some columns in Bootstrap 2 while leaving margins on other columns intact. (To remove gutters from all columns, just change the column and gutter variables in variables.less).
@import "mixins.less";
@import "variables.less";
.grid-no-gutter {
/* Removes margin from Bootstrap Grid. This class goes at least one level above row-fluid.
Works in Bootstrap 2. In Bootstrap 3, #grid has been removed. */
#grid > .fluid( percentage( 1 / @gridColumns ), 0 );
}
@je4d
je4d / gist:4341994
Created December 20, 2012 00:22
Demo of isolates with preemptible execution in v8 js
#include <chrono>
#include <memory>
#include <string>
#include <atomic>
#include <thread>
#include <iostream>
#include <v8.h>
int main()
{
@casualjim
casualjim / WebSocketClient.scala
Created February 13, 2012 19:42
A Netty based WebSocket client and server in scala
package mojolly.io
import org.jboss.netty.bootstrap.ClientBootstrap
import org.jboss.netty.channel._
import socket.nio.NioClientSocketChannelFactory
import java.util.concurrent.Executors
import org.jboss.netty.handler.codec.http._
import collection.JavaConversions._
import websocketx._
import java.net.{InetSocketAddress, URI}