Skip to content

Instantly share code, notes, and snippets.

View Sphinxxxx's full-sized avatar

Andreas Borgen Sphinxxxx

View GitHub Profile
@tomhodgins
tomhodgins / dragon.html
Last active October 11, 2017 05:02
Dragon.js is a bookmarklet that lets you drag any element on a website using a mouse or touchscreen. The goal is to speed up in-browser design critiques and brainstorming new layout ideas. Demo at http://staticresource.com/dragon.html
<!DOCTYPE html>
<html data-theme=dark>
<head>
<meta charset=utf-8>
<meta name=viewport content="width=device-width, initial-scale=1">
<title></title>
<link href=http://fonts.googleapis.com/css?family=Fira+Sans:300,400,500,700,300italic,400italic,500italic,700italic rel=stylesheet>
<link href=http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900,200italic,300italic,400italic,600italic,700italic,900italic rel=stylesheet>
<link href="//fonts.googleapis.com/css?family=PT+Serif:400,700,400italic,700italic" rel=stylesheet type=text/css>
<link href=http://staticresource.com/basic.css rel=stylesheet>
@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 = [];
@esbullington
esbullington / intro.md
Last active September 30, 2018 11:59
Convert Stylus to SASS/SCSS

Convert Stylus to SASS

Here's how I converted a whole batch of Stylus files to SASS without using a converter (none exist, that I'm aware of), converting each Stylus file manually, or programming my own Stylus->SASS converter, which would have entailed building a parser, and then generate SCSS from the AST.

First, grab sandr.py here: https://github.com/jfgiraud/sandr

Then, in the directory of your Stylus files, run (if you have multiple directory levels, you can do similar task using find):

for file in *.styl; do echo "/*! FILENAME: $file */" >tempfile; cat $file >>tempfile; mv tempfile $file; done 
@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.

@swissspidy
swissspidy / language-updates-table.php
Last active April 4, 2020 11:20
Display a table with available translation updates on the WordPress update screen
<?php
/**
* Plugin Name: Translation Updates Table
*
* @author Pascal Birchler <pascal@required.ch>
* @license GPL2+
*/
/**
* Displays a table with available translation updates.
@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") {
@mjs
mjs / fib.rs
Created August 25, 2017 01:54
Fibonacci sequence generation done in 3 ways using Rust
const ITERS: usize = 20;
fn print_fib(n: usize) {
let mut x = (1, 1);
for i in 0..n {
println!("{}: {}", i, x.0);
x = (x.1, x.0 + x.1)
}
}
@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.