Skip to content

Instantly share code, notes, and snippets.

@belohlavek
belohlavek / binaryUtil.js
Last active January 3, 2023 16:37
ASCII to Binary and Binary to ASCII Utility functions in Javascript.
var Util = {
toBinary: function(input) {
var result = "";
for (var i = 0; i < input.length; i++) {
var bin = input[i].charCodeAt().toString(2);
result += Array(8 - bin.length + 1).join("0") + bin;
}
return result;
},
@belohlavek
belohlavek / gh-pages-deploy.md
Last active August 21, 2022 19:33 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. Here's how to do it:

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore (or skip and force-add afterwards).

@belohlavek
belohlavek / typescriptreact.json
Last active April 19, 2017 03:59
Typescript react snippets vscode
{
"React Pure Component": {
"prefix": "reclass",
"body": [
"import * as React from 'react';\n",
"export interface IProps {\n",
"}\n",
"export interface IState {\n",
"}\n",
"class $1 extends React.PureComponent<IProps, IState> {\n",
@belohlavek
belohlavek / poller.go
Last active May 28, 2017 14:51
Micro poller written in go
package main
// go run poller.go --interval 1
import (
"flag"
"log"
"net/http"
"time"
)
@belohlavek
belohlavek / __inputs__someInput.json
Last active November 20, 2017 14:05
Test dwl gist
{
"a": "success!"
}
@belohlavek
belohlavek / _script_main.dwl
Created November 21, 2017 15:05
Untitled project
%dw 2.0
output application/json
---
payload.message
@belohlavek
belohlavek / __inputs__payload.json
Created November 21, 2017 15:13
Untitled project
{
"message": "Hello world!"
}
@belohlavek
belohlavek / __inputs__payload.json
Last active November 21, 2017 15:52
Untitled project
{
"message": "Hello world!!!!"
}
@belohlavek
belohlavek / __inputs__payload.json
Created November 21, 2017 15:53
Untitled project
{
"message": "Hello world!!!!"
}
@belohlavek
belohlavek / __inputs__payload.json
Created November 29, 2017 19:48
Untitled project
{
"message": "Hello world!"
}