Skip to content

Instantly share code, notes, and snippets.

View gunharth's full-sized avatar

Gunharth Randolf gunharth

  • Innsbruck, Austria
View GitHub Profile
@gunharth
gunharth / calc.js
Created December 25, 2018 21:04 — forked from rockstar2046/calc.js
High-precision calculation for javascript,You can call add,sub,mul,div to calculate you variables.
/**
* @fileOverview Javascript high precision calculate
* @author ra <ra@rockagen.com>
* @version 0.1
* @see {@link http://usejsdoc.org|jsdoc}
* @example
*
* 0.05 + 0.01 //0.060000000000000005
* 1.0 - 0.42 //0.5800000000000001
* 4.015 * 100 //401.49999999999994
@gunharth
gunharth / .env.travis
Created August 17, 2016 13:13 — forked from gilbitron/.env.travis
Laravel 5 Travis CI config
APP_ENV=testing
APP_KEY=SomeRandomString
DB_CONNECTION=testing
DB_TEST_USERNAME=root
DB_TEST_PASSWORD=
CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
@gunharth
gunharth / intro.markdown
Created May 26, 2016 20:25 — forked from tillsanders/intro.markdown
Laravel: drag-and-drop repositioning with auto-save of DB entries

Laravel: drag-and-drop repositioning with auto-save of DB entries

Use case: Database entries are represented in a table. By grabbing and moving a row up or down the table, you can change the entries' order/position. The changes are submitted automatically via ajax.

  • Uses jQueryUI (custom download: sortable is needed)
  • newly created elements are added to the top (see route /jobs/create)
@gunharth
gunharth / gh-pages-deploy.md
Created November 5, 2015 11: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. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

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 file (it’s ignored by default by Yeoman).

echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh