Skip to content

Instantly share code, notes, and snippets.

@crykn
crykn / SeaShaderExample.java
Last active February 17, 2021 20:01
This is a simple example of how to render this sea shader (http://glslsandbox.com/e#69872.0) in libGDX.
package issue.test;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Mesh;
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
@soygul
soygul / youtube-upload.js
Last active May 3, 2024 13:41
YouTube video uploader using JavaScript and Node.js
// YouTube API video uploader using JavaScript/Node.js
// You can find the full visual guide at: https://www.youtube.com/watch?v=gncPwSEzq1s
// You can find the brief written guide at: https://quanticdev.com/articles/automating-my-youtube-uploads-using-nodejs
//
// Upload code is adapted from: https://developers.google.com/youtube/v3/quickstart/nodejs
const fs = require('fs');
const readline = require('readline');
const assert = require('assert')
const {google} = require('googleapis');
@181192
181192 / increase_root_fedora.md
Last active May 6, 2024 07:07
How to increase the root partition size on Fedora

How to increase the root partition size on Fedora

Boot up with an Fedora Live USB stick.

  1. Run vgs to check if there's any space:
$ sudo vgs
  VG     #PV #LV #SN Attr   VSize    VFree
  fedora   1   3   0 wz--n- <237.28g    0 
@Kinwailo
Kinwailo / FrustumAABBIntersect.cpp
Last active November 23, 2023 15:09
Frustum AABB Intersect
// Returns: INTERSECT : 0
// INSIDE : 1
// OUTSIDE : 2
int FrustumAABBIntersect(Plane *planes, Vector &mins, Vector &maxs) {
int ret = INSIDE;
Vector vmin, vmax;
for(int i = 0; i < 6; ++i) {
// X axis
if(planes[i].normal.x > 0) {
@dmytrodanylyk
dmytrodanylyk / res_color_btn_flat_selector.xml
Last active March 4, 2023 07:52
Material Flat Button Style
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false"
android:color="@color/flat_disabled_text"/>
<item android:color="@color/flat_normal_text"/>
</selector>
#include <errno.h>
#include <fcntl.h>
#include <linux/videodev2.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <opencv2/core/core.hpp>
@MobiDevelop
MobiDevelop / ArchiveFileHandle.java
Created May 3, 2013 21:28
A ZipFile-based FileHandle implementation for LibGDX.
package com.mobidevelop.gdx.examples;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import com.badlogic.gdx.Files.FileType;
import com.badlogic.gdx.files.FileHandle;
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream