Skip to content

Instantly share code, notes, and snippets.

@zodsoft
zodsoft / renameillegalfiles.py
Created June 30, 2021 04:02 — forked from openp2pdesign/renameillegalfiles.py
Check and rename files with illegal chars
# -*- encoding: utf-8 -*-
#
# Author: Massimo Menichinelli
# Homepage: http://www.openp2pdesign.org
# License: MIT
#
import string
import os
@zodsoft
zodsoft / PDF_extract_images.py
Created June 18, 2021 07:27 — forked from gstorer/PDF_extract_images.py
Extract images from a PDF file using Python, Pillow (PIL) and PyPDF2
# coding=utf-8
from __future__ import print_function
"""
The MIT License (MIT)
Copyright (c) 2018 Louis Abraham <louis.abraham@yahoo.fr>
Copyright ©2016 Ronan Paixão
Copyright (c) 2018 Gerald Storer
\x1B[34m\033[F\033[F
@zodsoft
zodsoft / convert.py
Created May 31, 2021 13:59 — forked from michaelosthege/convert.py
Convert MP4/AVI clips to GIF with a single Python function
import imageio
import os, sys
class TargetFormat(object):
GIF = ".gif"
MP4 = ".mp4"
AVI = ".avi"
def convertFile(inputpath, targetFormat):
"""Reference: http://imageio.readthedocs.io/en/latest/examples.html#convert-a-movie"""
@zodsoft
zodsoft / AndroidManifest.xml
Created November 21, 2018 13:38 — forked from bjoernQ/AndroidManifest.xml
Creating a System Overlay (Always on Top over all Apps) in Android
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.mobilej.overlay"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="14" />
<application android:label="SystemOverlay" >
<activity
@zodsoft
zodsoft / xd2md.cs
Created May 24, 2018 10:09 — forked from formix/xd2md.cs
Generates Markdown From VisualSturio XML documentation files
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using System.Xml;
using System.Xml.Linq;
namespace Formix.Utils
{
class Program
@zodsoft
zodsoft / vtable.cpp
Created May 2, 2018 07:18 — forked from netguy204/vtable.cpp
Monkey patching a C++ class by modifying its VTABLE.
#include <stdio.h>
#include <stdint.h>
class A {
public:
virtual void doThing() {
printf("I'm an A\n");
}
};
#! python3
import shlex
import sys
import re
import io
header = open('openvr.h', newline='\n').read()
annoyingMacroPattern = re.compile(r'#define\s+(\w+).*VR_CLANG_ATTR.*')
@zodsoft
zodsoft / read-csv-to-eigen.cpp
Created June 12, 2017 14:02
Reads a CSV file into a Eigen Matrix
#include <iostream>
#include <fstream>
#include <Eigen/Dense>
Eigen::MatrixXd readCSV(std::string file, int rows, int cols) {
std::ifstream in(file);
std::string line;
@zodsoft
zodsoft / README.md
Created July 4, 2016 11:28 — forked from fnichol/README.md
Download a cacert.pem for RailsInstaller

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)

using System.Collections.Generic;
using System.Reflection;
namespace UnityEngine.EventSystems
{
[AddComponentMenu("Event/Standalone Input Module")]
public class StandaloneInputModule : PointerInputModule
{
private float m_NextAction;