Skip to content

Instantly share code, notes, and snippets.

View Sphinxxxx's full-sized avatar

Andreas Borgen Sphinxxxx

View GitHub Profile
@leommoore
leommoore / file_magic_numbers.md
Last active April 28, 2024 01:26
File Magic Numbers

File Magic Numbers

Magic numbers are the first bits of a file which uniquely identify the type of file. This makes programming easier because complicated file structures need not be searched in order to identify the file type.

For example, a jpeg file starts with ffd8 ffe0 0010 4a46 4946 0001 0101 0047 ......JFIF.....G ffd8 shows that it's a JPEG file, and ffe0 identify a JFIF type structure. There is an ascii encoding of "JFIF" which comes after a length code, but that is not necessary in order to identify the file. The first 4 bytes do that uniquely.

This gives an ongoing list of file-type magic numbers.

Image Files

@domenic
domenic / 0-github-actions.md
Last active April 8, 2024 23:35
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with GitHub Actions

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:

  • It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
  • It is free, with no quotas.
  • Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
@ilyazub
ilyazub / excel_xml_spreadsheet_example.md
Last active January 4, 2023 03:47
Excel 2003 XML Spreadsheet example

Excel 2003 XML Spreadsheet example

Example

image

spreadsheet.xml

Solved errors

Problem During Load because of wrong ss:ExpandedRowCount.

@jacobrossi
jacobrossi / gist:a003bbc2987db506c5fc
Last active October 30, 2021 13:30
List of Touches - Pointer Events standard
//Code to create a list of touches called pointerList
var pointerList = []; //Array of all the pointers on the screen
window.addEventListener("pointerdown", updatePointer, true);
window.addEventListener("pointermove", updatePointer, true);
window.addEventListener("pointerup", remPointer, true);
window.addEventListener("pointercancel", remPointer, true);
function updatePointer(e) {
if(e.pointerType === "touch") {
@vinceallenvince
vinceallenvince / README.md
Last active April 13, 2019 05:24
CI with Travis, github Releases API, gh-pages and npm publish

CI with Travis, GitHub Releases API and gh-pages

When hosting a project on GitHub, it's likely you'll want to use GitHub Pages to host a public web site with examples, instructions, etc. If you're not using a continuous integration service like Travis, keeping your gh-pages site up to date requires continuous wrangling.

The steps below outline how to use Travis CI with GitHub Releases and GitHub Pages to create a "1-button" deployment workflow. After testing and running a release build, Travis will upload your release assets to GitHub. It will also push a new version of your public facing site to GitHub Pages.

Organize your project

Let's assume you are hosting a JavaScript project that will offer a single JavaScript file as a release asset. It's likely you'll organize your files like this.

@lsegal
lsegal / anagram.js
Last active December 28, 2017 23:46 — forked from stevepm/anagram.js
function anagram(word) {
var originalWord = wordObject(word);
return {
matches: function(wordArray) {
if (typeof wordArray === 'string'){
wordArray = Array.prototype.slice.call(arguments);
}
var wordMatches = [];
@indexzero
indexzero / ISC.md
Created April 13, 2014 21:00
ISC vs. MIT

Copyright (c) 4-digit year, Company or Person's Name

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Source: http://opensource.org/licenses/ISC

@timo22345
timo22345 / flatten.js
Last active March 13, 2024 17:06
Flatten.js, general SVG flattener. Flattens transformations of SVG shapes and paths. All shapes and path commands are supported.
<!doctype html>
<html>
<title>Flatten.js, General SVG Flattener</title>
<head>
<script>
/*
Random path and shape generator, flattener test base: https://jsfiddle.net/fjm9423q/embedded/result/
Basic usage example: https://jsfiddle.net/nrjvmqur/embedded/result/
@faraday
faraday / selective_gaussian_blur.c
Created February 18, 2014 18:37
Adaptation of Selective Gaussian Blur Noise Reduction (SGBNR) that works with PPM images
/** CENG466 HW1 - 2006/2007 - 1st Semester
*
* - Team -
* Cagatay Calli
* Felix Wolfsteller
*
* - Summary -
* Implemented an original adaptation of Selective Gaussian Blur (SGBNR)
*(given name: Varying Multi-pass Isotropic Selective Gaussian Blur, VMISGB),
* using a Gaussian mask having double type values.