Skip to content

Instantly share code, notes, and snippets.

View aberba's full-sized avatar

Lawrence Aberba aberba

View GitHub Profile
@aberba
aberba / ReactTippy.jsx
Created February 16, 2019 22:02
React Component for Tippy.js
import React from 'react'
import ReactDOM from 'react-dom'
import tippy from 'tippy.js'
class Tippy extends React.Component {
html = React.createRef()
componentDidMount() {
const { children, ...props } = this.props
this.tippyInstance = tippy.one(ReactDOM.findDOMNode(this), {
@aberba
aberba / example.js
Created January 20, 2020 16:31 — forked from faisalman/example.js
7-bit GSM 03.38 <-> Unicode Map in JS
// Unicode to 7-bit GSM
var write = "Hello, Faisalman!";
var msgSubmit = "";
write.split('').forEach(function(i) {
msgSubmit += parseInt(Unicode2GSM[i], 10).toString(16).toUpperCase() + " ";
});
console.log(msgSubmit); // "48 65 6C 6C 6F 2C 20 46 61 69 73 61 6C 6D 61 6E 21 "
// 7-bit GSM to Unicode
var read = "48 65 6C 6C 6F 2C 20 46 61 69 73 61 6C 6D 61 6E 21 ";
@aberba
aberba / install.sh
Last active March 17, 2020 04:06
install DSFML dependencies for D (dlang) on linux
sudo sudo apt-get install freeglut3-dev libxrandr-dev libfreetype6-dev libglew-dev libjpeg-dev libopenal-dev libsndfile-dev libpthread-stubs0-dev
import std.datetime : Clock;
import std.stdio;
import arsd.simpledisplay;
import arsd.nanovega;
import nanogui.sdlbackend : SdlBackend;
class MyGui : SdlBackend
{
this(int w, int h, string title)
{
import std.datetime : Clock;
import std.stdio;
import arsd.simpledisplay;
import arsd.nanovega;
import nanogui.sdlbackend : SdlBackend;
class MyGui : SdlBackend
{
this(int w, int h, string title)
{

D web development package

These are some recommended D web development packages from Dub you may need. These following are choosing because I've either personally used them or they have good documentation.

Any recommendation? Please let me know in the comments.

Web frameworks

  • vibe-d (its like Express.js from Node.js/Javascript)
  • hunt-framework (its like Laravel from PHP)

Json parsing and serialization

import arsd.nanovega;
import nanogui.sdlbackend : SdlBackend;
class MyGui : SdlBackend
{
this(int w, int h, string title)
{
super(w, h, title);
}
@aberba
aberba / vscode_shortcuts.md
Created July 26, 2020 20:27 — forked from bradtraversy/vscode_shortcuts.md
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

Its not immediately obvious what to do with prebuilt binaries in releases of Raylib. This is how to install the binanries on Debian-based distros.

cd raylib-3.0.0-Linux-amd64
sudo cp lib/libraylib.** /usr/local/lib/
sudo cp include/raylib.h /usr/local/include/
ln -s libraylib.so.3.0.0 libraylib.so.301 
ln -s libraylib.so.301 libraylib.so
sudo ldconfig
[
{
"name": "Ahafo",
"code": ""
},
{
"name": "Ashanti",
"code": ""
},
{