Skip to content

Instantly share code, notes, and snippets.

@finalfantasia
finalfantasia / fixing_text_anti_aliasing_in_fedora.md
Last active September 15, 2024 18:58
Fixing Text Anti-aliasing in Fedora
  1. Add the RPMFusion repositories (both free and non-free) to the YUM repository directory (/etc/yum.repos.d/):
sudo dnf localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
  1. Install the patched version of FreeType with subpixel rendering enabled:
sudo dnf install -y freetype-freeworld
@willpatera
willpatera / Google-Sheet-Form-Post.md
Last active November 9, 2024 15:22
Post to google spreadsheet from html form

Overview

This collection of files serves as a simple static demonstration of how to post to a google spreadsheet from an external html <form> following the example by Martin Hawksey

Depreciation Warning: This code is not maintained, and should be seen as reference implementation only. If you're looking to add features or update, fork the code and update as needed.

Run example

You should be able to just open index.html in your browser and test locally.

@karussell
karussell / GridTraversal.java
Created July 10, 2014 22:38
Fast Voxel Grid Traversal Algorithm
public static void calcPoints( double y1, double x1, double y2, double x2,
PointEmitter emitter )
{
int x = (int) x1, y = (int) y1;
int endX = (int) x2, endY = (int) y2;
// deltaX and Y is how far we have to move in ray direction until we find a new cell in x or y direction
// y = u + t * v, where u=(x1,x2) and v=(stepX,stepY) is the direction vector
final double gridCellWidth = 1, gridCellHeight = 1;
@pcarrier
pcarrier / _instructions
Last active December 26, 2021 17:23
Chrome Remote Desktop
The remote desktop session has to be headless :(
- Install the deb (can convert with alien & co)
- Patch with modern_distro.diff (cherry-pick what your system needs)
- To support automatic desktop resizing:
- Works with any window manager
- Build Xvfb with xvfb-randr.diff
- Expose as /usr/bin/Xvfb-randr
- If replacing system-wide binary by repackaging, simply
# ln -sf Xvfb /usr/bin/Xvfb-randr
@johnmiedema
johnmiedema / TestCustomOpenNlpModel
Last active March 11, 2019 22:23
Test a custom OpenNLP model
//Test a custom OpenNLP model for NER of book titles
//See https://gist.github.com/johnmiedema/4020deea875ce306971e
package demoModelTrainer;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import opennlp.tools.namefind.NameFinderME;
@Smerity
Smerity / part-r-00000
Created April 6, 2014 23:38
Output from the Common Crawl HTML tag frequency count run over a single compressed 859MB WARC file
0 48
0000 6
0l 1
0xdc00 13
1 69
10 11
100 3
1001 1
100154 1
1004 1
@subudeepak
subudeepak / WebSockets.md
Last active December 4, 2024 13:36
The problems and some security implications of websockets - Cross-site WebSockets Scripting (XSWS)

WebSockets - An Introduction

WebSockets is a modern HTML5 standard which makes communication between client and server a lot more simpler than ever. We are all familiar with the technology of sockets. Sockets have been fundamental to network communication for a long time but usually the communication over the browser has been restricted. The general restrictions

  • The server used to have a permanent listener while the client (aka browser) was not designated any fixed listener for a more long term connection. Hence, every communication was restricted to the client demanding and the server responding.
  • This meant that unless the client requested for a particular resource, the server was unable to push such a resource to the client.
  • This was detrimental since the client is then forced to check with the server at regular intervals. This meant a lot of libraries focused on optimizing asynchronous calls and identifying the response of asynchronous calls. Notably t
@kouphax
kouphax / README.md
Last active August 29, 2015 13:57
Ungisting Files and Tidying up Metadata

This gist covers

  • some of the snippets of code that was used to remove the gists from generated pages.
  • The tidying up of metadata and project strcuture
@SalvaJ
SalvaJ / GoogleAPI.py
Last active June 7, 2016 13:47
Example making HTTP request to use Google API without api-client.It works in Python3 (tested ok in 3.3.5)
#!usr/bin/python3
# -*- coding: UTF-8 -*-
"""This module is a sample of the OAuth2 authentication by Python3"""
__version__ = "0.1.0"
__author__ = "shin (shin.hateblo.jp)"
__copyright__ = "(C) 2012 shin"
__email__ = "[email protected]"
__license__ = "Apache License 2.0"
@freeman-lab
freeman-lab / StreamingKMeans.scala
Last active February 26, 2019 07:13
Spark Streaming + MLLib integration examples
package thunder.streaming
import org.apache.spark.{SparkConf, Logging}
import org.apache.spark.rdd.RDD
import org.apache.spark.SparkContext._
import org.apache.spark.streaming._
import org.apache.spark.streaming.dstream.DStream
import org.apache.spark.mllib.clustering.KMeansModel
import scala.util.Random.nextDouble