Skip to content

Instantly share code, notes, and snippets.

View seyyah's full-sized avatar

seyyah seyyah

View GitHub Profile
@seyyah
seyyah / getColourfulness.m
Created March 7, 2022 11:31 — forked from zabela/getColourfulness.m
Algorithm to measure images colourfulness, adapted from "Measuring colourfulness in natural images" (Hasler and Susstrunk, 2003) http://infoscience.epfl.ch/record/33994/files/HaslerS03.pdf
function C = getColourfulness( im )
%
% C = getColourfulness( im )
%
% MATLAB algorithm implementation of the
% "Measuring colourfulness in natural images"
% (Hasler and Susstrunk, 2003)
%
% Input:
% im - image in RGB

There are several approaches

  • Mount Google Drive in local Colab VM
  • Upload and download via browser
  • Use colab_util.py in python script
@seyyah
seyyah / devise.rb
Created January 2, 2020 07:35 — forked from bearded-avenger/devise.rb
Rails - SSO - WordPress - Authenticating against a WordPress install from a Rails site using oAuth
config.omniauth :wordpress_hosted, ENV['SSO_KEY'], ENV['SSO_SECRET'],
strategy_class: OmniAuth::Strategies::WordpressHosted,
client_options: { site: ENV['SSO_URL'] }
@seyyah
seyyah / LICENSE
Created May 28, 2019 08:27 — forked from sinisterchipmunk/LICENSE
tar, gzip, and untar files using ruby in memory without tempfiles
Copyright (C) 2011 by Colin MacKenzie IV
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
@seyyah
seyyah / Makefile
Created April 1, 2019 07:53 — forked from skeeto/Makefile
C Object Oriented Programming Example
CFLAGS = -std=c99 -Wall
main : main.o
.PHONY : test clean
test : main
./$^ "*regex*" "*vtable*" < main.c
clean :
@seyyah
seyyah / fail2ban_notifier.rb
Created March 3, 2019 15:26 — forked from etdsoft/fail2ban_notifier.rb
Simple Fail2banNotifier for exception_notification (will submit a pull request and update gist when accepted). See: http://securityroots.com/blog/2014/01/protecting-app-rails-fail2ban/
class Fail2banNotifier
def initialize(options)
@default_options = options
@default_options[:logfile] ||= Rails.root.join('log', 'fail2ban.log')
# Roll over every 30M, keep 10 files
@logger ||= Logger.new(@default_options[:logfile], 10, 30*1024*1024)
end
def call(exception, options={})
@seyyah
seyyah / gist:6a6408e54592aba04a27b71972e8a52b
Created February 1, 2019 07:16 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@seyyah
seyyah / nginx.conf
Created January 31, 2019 19:25 — forked from edib/nginx.conf
moodle subdirectory inside a wordpress installation
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/wordpress;
index index.php index.html index.htm index.nginx-debian.html;
server_name _;
@seyyah
seyyah / stm32_hal_uart_receive_it_example.c
Created January 4, 2019 14:21 — forked from monpetit/stm32_hal_uart_receive_it_example.c
STM32 HAL Driver Receive with Interrupt example
#include "stm32f1xx_hal.h"
UART_HandleTypeDef UartHandle; /* UART 핸들러 */
__IO ITStatus UartReady = RESET; /* UART 상태 지시자 */
#define RXBUFFERSIZE 10
uint8_t aRxBuffer[RXBUFFERSIZE]; /* UART 수신 버퍼 */
int main(void)
@seyyah
seyyah / gist:68765065d8f47055bdf0786fa9b4ca4e
Created October 18, 2018 10:43 — forked from ryannealmes/gist:aa4eed8b222239c9e207
Update Git submodule to latest commit on origin
# get the submodule initially
git submodule add ssh://bla submodule_dir
git submodule init
# time passes, submodule upstream is updated
# and you now want to update
# change to the submodule directory
cd submodule_dir