Skip to content

Instantly share code, notes, and snippets.

View kadko's full-sized avatar
🍀
On vacation

kadko

🍀
On vacation
View GitHub Profile
@Qix-
Qix- / coro.cpp
Created September 29, 2020 04:16
C++20 coroutines + LibUV sample, v2
// Thank you to the folks at the C++ slack channel,
// along with @lewissbaker for the excellent literature
// (even though it took me a few days to be convinced
// it really was so).
#include <uv.h>
#include <iostream>
#include <experimental/coroutine>
@SuperKogito
SuperKogito / CaptureSceenshotUsingOpenCV.cpp
Last active November 10, 2023 09:08
Code for my blog post <https://superkogito.github.io/blog/CaptureScreenUsingOpenCv.html> A snippet for capturing the screen content using OpenCV
/*****************************************************************************************************************
* \file CaptureSceenshotUsingOpenCV.cpp
* \brief capture screenshot using OpenCV and save it as a png.
*
* \author SuperKogito
* \date July 2020
*
* @note:
* references and sources:
* - http://msdn.microsoft.com/en-us/library/windows/window/dd183402%28v=vs.85%29.aspx
@dalezak
dalezak / README.md
Last active September 11, 2023 09:51
Ionic Capacitor Resources Generator
  1. Run npm install cordova-res --save-dev
  2. Create 1024x1024px icon at resources/icon.png
  3. Create 2732x2732px splash at resources/splash.png
  4. Add "resources": "cordova-res ios && cordova-res android && node scripts/resources.js" to scripts in package.json
  5. Copy resources.js file to scripts/resources.js
  6. Run sudo chmod -R 777 scripts/resources.js
  7. Run npm run resources
@jordantrizz
jordantrizz / gist:6cf84aadd3bdc9383dfa04a20b181013
Created September 27, 2018 18:15
Installing Redis PHP 7.2 Module for Litespeed Native on Ubuntu 18
# Pre-req is the Litespeed Ubuntu repository
apt-get install lsphp72-dev
cd /tmp
wget https://github.com/phpredis/phpredis/archive/master.zip -O phpredis.zip
unzip -o /tmp/phpredis.zip
mv /tmp/phpredis-* /tmp/phpredis
cd /tmp/phpredis
/usr/local/lsws/lsphp72/bin/phpize7.2
./configure --with-php-config=/usr/local/lsws/lsphp72/bin/php-config
make
@tgroshon
tgroshon / contact.html
Created April 10, 2017 17:21
Formatted snippet authored by Jeff Richards (http://www.jrichards.ca/)
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
function submitToAPI() {
var URL = ‘/contact’;
var data = {
name: $(‘#name-input’).val(),
email: $(‘#email-input’).val(),
description: $(‘#description-input’).val()
@jameshirka
jameshirka / gupfile-CI.js
Created September 30, 2016 05:49
A gulp file I used to do CI with a habitat based website.
var gulp = require("gulp");
var gutil = require("gulp-util");
var foreach = require("gulp-foreach");
var rimrafDir = require("rimraf");
var rimraf = require("gulp-rimraf");
var runSequence = require("run-sequence");
var fs = require("fs");
var path = require("path");
var xmlpoke = require("xmlpoke");
var config = require("./gulpfile.js").config;
@byrnedo
byrnedo / ComputeHmac256.go
Created September 12, 2016 07:32
Compute a hmac for a message in golang
func ComputeHmac256(message string, secret string) string {
key := []byte(secret)
h := hmac.New(sha256.New, key)
h.Write([]byte(message))
return base64.StdEncoding.EncodeToString(h.Sum(nil))
}
@santa4nt
santa4nt / HelloJNI.java
Last active June 2, 2024 17:19
Sample JNI/C++ HelloWorld
public class HelloJNI {
static {
System.loadLibrary("hello"); // loads libhello.so
}
private native void sayHello(String name);
public static void main(String[] args) {
new HelloJNI().sayHello("Dave");
}
@sawapi
sawapi / AppDelegate.swift
Last active October 25, 2023 09:26
[Swift] Push Notification
//
// AppDelegate.swift
// pushtest
//
// Created by sawapi on 2014/06/08.
// Copyright (c) 2014年 sawapi. All rights reserved.
//
// iOS8用
import UIKit
@aklinkert
aklinkert / log_all_socket_events.js
Last active January 14, 2019 19:42
Log all Sockets Events of an socket.io client
// pre 1.0
(function() {
var emit = socket.emit;
socket.emit = function() {
console.log('***','emit', Array.prototype.slice.call(arguments));
emit.apply(socket, arguments);
};
var $emit = socket.$emit;
socket.$emit = function() {
console.log('***','on',Array.prototype.slice.call(arguments));