Skip to content

Instantly share code, notes, and snippets.

View ByteDecoder's full-sized avatar
🏠
Working from home

Rodrigo Reyes ByteDecoder

🏠
Working from home
View GitHub Profile
@ByteDecoder
ByteDecoder / ScreenCaptureEditor.cs
Created May 30, 2021 00:12 — forked from Tymski/ScreenCaptureEditor.cs
Unity make a screenshot from editor
using System.IO;
using UnityEditor;
using UnityEngine;
public class ScreenCaptureEditor : EditorWindow
{
private static string directory = "Screenshots/Capture/";
private static string latestScreenshotPath = "";
private bool initDone = false;
@ByteDecoder
ByteDecoder / date_helper.js
Created April 7, 2021 22:35 — forked from shuber/date_helper.js
fuzzy timestamps, time ago in words
var DateHelper = {
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time
// Ruby strftime: %b %d, %Y %H:%M:%S GMT
time_ago_in_words_with_parsing: function(from) {
var date = new Date;
date.setTime(Date.parse(from));
return this.time_ago_in_words(date);
},
time_ago_in_words: function(from) {
@ByteDecoder
ByteDecoder / timeago.js
Created April 7, 2021 21:30 — forked from caiotarifa/timeago.js
"Distance of Time in Words" in Vanilla JavaScript.
var TimeAgo = (function() {
var self = {};
// Public Methods
self.locales = {
prefix: '',
sufix: 'ago',
seconds: 'less than a minute',
minute: 'about a minute',
@ByteDecoder
ByteDecoder / CreateTilesFromTileset.cs
Created November 20, 2020 08:19 — forked from omardelarosa/CreateTilesFromTileset.cs
Tilemap Importer - PyxelEdit to Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.Tilemaps;
using System.IO;
public class CreateTilesFromTileset : EditorWindow
{
int padding = 5;
int buttonHeight = 25;
@ByteDecoder
ByteDecoder / CreateTilesFromTileset.cs
Created November 20, 2020 08:19 — forked from omardelarosa/CreateTilesFromTileset.cs
Tilemap Importer - PyxelEdit to Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.Tilemaps;
using System.IO;
public class CreateTilesFromTileset : EditorWindow
{
int padding = 5;
int buttonHeight = 25;
@ByteDecoder
ByteDecoder / regenerate_credentials.md
Created October 31, 2020 01:37 — forked from db0sch/regenerate_credentials.md
How to regenerate the master key for Rails 5.2 credentials

If your master.key has been compromised, you might want to regenerate it.

No key regeneration feature at the moment. We have to do it manually.

  1. Copy content of original credentials rails credentials:show somewhere temporarily.
  2. Remove config/master.key and config/credentials.yml.enc
  3. Run EDITOR=vim rails credentials:edit in the terminal: This command will create a new master.key and credentials.yml.enc if they do not exist.
  4. Paste the original credentials you copied (step 1) in the new credentials file (and save + quit vim)
  5. Add and Commit the file config/credentials.yml.enc
@ByteDecoder
ByteDecoder / string.compress.js
Created September 16, 2020 19:03 — forked from fliptopbox/string.compress.js
JavaScript String compression
/*
@fliptopbox
LZW Compression/Decompression for Strings
Implementation of LZW algorithms from:
http://rosettacode.org/wiki/LZW_compression#JavaScript
Usage:
var a = 'a very very long string to be squashed';
var b = a.compress(); // 'a veryāăąlong striċ to bečquashed'
@ByteDecoder
ByteDecoder / license-badges.md
Created September 9, 2020 17:01 — forked from lukas-h/license-badges.md
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.  

Translations: (No guarantee that the translations are up-to-date)

@ByteDecoder
ByteDecoder / .editorconfig
Last active August 31, 2020 20:52
Kontra + Parcel + TypeScript + ESlint + Prettier
root = true
[*]
end_of_line = lf
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@ByteDecoder
ByteDecoder / create-gh-pages.sh
Created August 14, 2020 06:32
Create the gh-pages branch
git checkout --orphan gh-pages
git reset .
rm -r *
rm .gitignore
echo 'The documentation will be here.' > index.html
git add index.html
git commit -m 'Initialize the gh-pages orphan branch'
git push -u origin gh-pages