Skip to content

Instantly share code, notes, and snippets.

View sim642's full-sized avatar

Simmo Saan sim642

View GitHub Profile
@sim642
sim642 / DI.m3u
Created July 5, 2015 12:52
Digitally Imported premium streams
#EXTM3U
#EXTINF:-1,Digitally Imported - Ambient
http://pub1.diforfree.org:8000/di_ambient_hi
#EXTINF:-1,Digitally Imported - Big Room House
http://pub1.diforfree.org:8000/di_bigroomhouse_hi
#EXTINF:-1,Digitally Imported - Breaks
http://pub1.diforfree.org:8000/di_breaks_hi
@sim642
sim642 / boost-windows.md
Last active February 7, 2024 16:43
Installing boost libraries for GCC (MinGW) on Windows

Installing boost libraries for GCC (MinGW) on Windows

Folder setup

  1. Extract downloaded boost source, e.g. C:\Program Files\boost_1_59_0.
  2. Create a folder for Boost.Build installation, e.g. C:\Program Files\boost-build.
  3. Create a folder within for building, i.e. C:\Program Files\boost_1_59_0\build.
  4. Create a folder for installation, e.g. C:\Program Files\boost.

GCC setup

  1. Open Command Prompt.
@sim642
sim642 / main.cpp
Last active January 10, 2024 19:12
Multidimensional std::vector creation wrapper
#include <iostream>
#include "multivector.hpp"
using namespace std;
int main()
{
auto v = make_multivector(3, 2, 1, 5, 0.5);
for (auto x : v)
@sim642
sim642 / reddit-sendbird.ts
Last active March 11, 2023 21:36
Reddit Chat (via SendBird) reverse engineering
import * as request from "request";
import * as SendBird from "sendbird";
const sendbirdServiceUrl = "https://sendbird.reddit.com";
const sendbirdAppId = "2515BDA8-9D3A-47CF-9325-330BC37ADA13";
const userId = "t2_mv8j9bt"; // chatrev1
const accessToken = "49777998329-oof4CSA1jedsnu6pXgJj_SFIk7o";
// accessToken (bearer):
// full (personalized) oauth2 access token (from web/installed reddit app): user id base 10 - oauth2 access token
@sim642
sim642 / golomb.hs
Created June 3, 2021 15:57
Haskell Golomb sequence
golomb@(_:_:g) = 1 : 2 : 2 : concatMap (uncurry replicate) (zip g [3..])
-- golomb = 1 : 2 : g
-- where g = 2 : concatMap (uncurry replicate) (zip g [3..])
@sim642
sim642 / delegate.hpp
Last active July 22, 2020 17:27
C++11 variadic template class for C# equivalent of delegates.
#ifndef DELEGATE_HPP_INCLUDED
#define DELEGATE_HPP_INCLUDED
#include <functional>
#include <vector>
// general case
template<typename R, typename... Args>
class delegate
{
@sim642
sim642 / newline.patch
Last active July 18, 2020 07:31
WeeChat WIP patch for rendering \n in messages
diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c
index 7fb229e88..c65db3302 100644
--- a/src/gui/curses/gui-curses-chat.c
+++ b/src/gui/curses/gui-curses-chat.c
@@ -1244,8 +1244,10 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
int read_marker_x, read_marker_y;
int word_start_offset, word_end_offset;
int word_length_with_spaces, word_length;
+ int num_split_lines, i;
char *message_with_tags, *message_with_search;
module SICPInfSeries where
-- SICP, exercise 3.59
integrateSeries :: Fractional a => [a] -> [a]
-- integrateSeries s = helper s 1
-- where helper (a:as) n = a / n : helper as (n + 1)
integrateSeries s = zipWith (/) s nats
where nats = 1 : map (+1) nats
expSeries :: Fractional a => [a]