Skip to content

Instantly share code, notes, and snippets.

View blurymind's full-sized avatar

Todor Imreorov blurymind

View GitHub Profile
@eduncan911
eduncan911 / Revert-Gist.md
Last active January 10, 2025 10:05
Revert Gist Commits

Revert / Undo a Gist Commit

It was not exactly obvious. Here's how to revert a Gist commit!

Checkout the gist like a normal git repo:

# replace the Gist ID with your own
git clone [email protected]:cc13e0fcf2c348cc126f918e4a3917eb.git

Treat it like a normal repo. Edit, force push, etc.

@juniorcesarabreu
juniorcesarabreu / Upload images to a gist.md
Last active August 10, 2024 20:54
How do you upload images to a gist?

How do you upload images to a gist?

  1. Create a gist or reuse one of your gists.
  2. Clone your gist:
git clone https://gist.github.com/<hash>.git
  1. Add your image to your gist's repository:
@msmfsd
msmfsd / es7-async-await.js
Last active February 4, 2024 17:38
Javascript fetch JSON with ES7 Async Await
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch
// async function
async function fetchAsync () {
// await response of fetch call
let response = await fetch('https://api.github.com');
// only proceed once promise is resolved
let data = await response.json();
// only proceed once second promise is resolved
@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
@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;">
    ...
@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;}
@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.
@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
@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" : [
@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