Skip to content

Instantly share code, notes, and snippets.

View blurymind's full-sized avatar

Todor Imreorov blurymind

View GitHub Profile
@matiaskorhonen
matiaskorhonen / acegist.user.js
Created April 10, 2012 13:55 — forked from abernier/acegist.user.js
ACE editor for editing your gists
// ==UserScript==
// @id acegist
// @name ACEgist
// @author Antoine BERNIER (abernier)
// @version 0.1.1
// @description ACE editor in your gists
// @match https://gist.github.com/gists/*/edit
// ==/UserScript==
(function (d, cb) {
@cheeming
cheeming / find_bad_revisions
Created June 23, 2012 03:29
A bash script to use git bisect to help bad revisions
#!/bin/bash
function print_usage () {
echo usage: $0 LAST_KNOWN_GOOD_REVISION '"TEST_COMMAND"'
echo LAST_KNOWN_GOOD_REVISION = you can specify this as sha1 hash
echo TEST_COMMAND = the script to run, it should return 0 if success
echo NOTE: Ensure that the current revision is the bad \(broken\)
exit 1;
}
@lanqy
lanqy / bytesToSize.js
Created March 19, 2013 03:05
JavaScript To Convert Bytes To MB, KB, Etc
// from http://scratch99.com/web-development/javascript/convert-bytes-to-mb-kb/
function bytesToSize(bytes) {
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes == 0) return 'n/a';
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
if (i == 0) return bytes + ' ' + sizes[i];
return (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i];
};
@joyrexus
joyrexus / README.md
Created November 2, 2013 18:24
Load encoded thumbnail from a gist

Quick demo showing how to get a Base64-encoded thumbnail.png file from a gist.


Thumbnails are very handy visual indicators of the content of a block on bl.ocks.org, esp for rapidly surveying a user's collection.

However, many block creators don't add thumbnails because of the extra steps involved in adding them to a gist. Since the gist API doesn't let you upload binaries you end up having to clone you're gist to add a thumbnail. Note: @mbostock's gist to clone all gists is useful here.

It's been suggested that the gist-img shell script enables you to upload thumbnail images. That's at least half true. It automates the base64 encoding of png images prior to upload with @defunkt's gist CLI tool, so you end up u

@gnysek
gnysek / acejs_bbc
Created June 1, 2015 07:40
ACE js bbcode
define(function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var MyNewHighlightRules = function() {
this.$rules = {
"start" : [
@kived
kived / buildozer.spec
Created July 13, 2015 21:41
Kivy: Android audio streaming (mp4)
[app]
# (str) Title of your application
title = Audio Stream Test
# (str) Package name
package.name = audiostreamtest
# (str) Package domain (needed for android/ios packaging)
package.domain = org.kivy
@aoloe
aoloe / webrtc-editor.md
Last active March 19, 2023 06:41
webrtc collaborative document editing

specification:

  • php server storing a server.
  • the first person opening a file becomes the master and is in charge to save to the server
  • all other users open webrtc connection to the master and keep the document in sync with him
  • if it makes things easier, only allow one user at a time to edit a block (paragraph, list, section)

todo:

  • check if and how to get webrtc to work without a node server.
  • try to convert a chat example in a text editor.
@tilomitra
tilomitra / animations.css
Last active March 27, 2023 13:55
Common CSS Infinite Animations (pulsate, opacityPulse, alertPulse, rotating).
/* Make the element pulse (grow large and small slowly) */
/* Usage
.myElement {
animation: pulsate 1s ease-out;
animation-iteration-count: infinite;
opacity: 1;
}
*/
@-webkit-keyframes pulsate {
0% {-webkit-transform: scale(0.1, 0.1); opacity: 0.0;}
@niksumeiko
niksumeiko / disable-html-form-input-autocomplete-autofill.md
Last active May 9, 2025 14:55
Disable HTML form input autocomplete and autofill

Disable HTML Form Input Autocomplete and Autofill

  1. Add autocomplete="off" onto <form> element;
  2. Add hidden <input> with autocomplete="false" as a first children element of the form.
<form autocomplete="off" method="post" action="">
    <input autocomplete="false" name="hidden" type="text" style="display:none;">
    ...
@MarianoGnu
MarianoGnu / fill_tileset_scene.gd
Created May 11, 2016 22:51
Fill a scene with autogenerated sprites with collisions to export as a tileset.
tool
extends EditorScript
# ------------------HOW TO USE-------------------------
# CONFIGURE CONSTANTS TO AUTOGENERATE THE TILESET SCENE
# -----------------------------------------------------
# PATH TO TEXTURE FILE