Skip to content

Instantly share code, notes, and snippets.

View Yonkokilasi's full-sized avatar
💭
Senior Mobile App Developer | Flutter

Joseph Kilasi Yonkokilasi

💭
Senior Mobile App Developer | Flutter
View GitHub Profile
@Yonkokilasi
Yonkokilasi / USB STICK TO RAM
Created May 20, 2017 06:17
This is a step by step guide to turning your USB stick into a sort of RAM for your laptop. I would recommend buying a physical RAM chip but this can suffice for now
Grab a USB stick, make sure there’s nothing on it you need (as it will be deleted!), and follow these steps:
Plug it in. If it automounts, unmount it.
Type: sudo mkswap /dev/sdb1 (or whatever your device path is)
Then type: sudo swapon -p 32767 /dev/sdb1 (the 32767 makes it a higher priority and will thus be used before the hard drive swap drive)
To make sure everything went well, type:
$ cat /proc/swaps
If you need to take the stick out, type:
$ sudo swapoff /dev/sdb1
Since I’ll be leaving this in the back of my desktop, first I got the UUID of the drive by typing:
@Yonkokilasi
Yonkokilasi / Heroku-psql
Last active May 14, 2017 17:49
Pushing a psql application to Heroku
1. In App.java
place this code in the public class App section
static int getHerokuAssignedPort() {
ProcessBuilder processBuilder = new ProcessBuilder();
if (processBuilder.environment().get("PORT") != null) {
return Integer.parseInt(processBuilder.environment().get("PORT"));
}
return 4567; //return default port if heroku-port isn't set (i.e. on localhost)
@Yonkokilasi
Yonkokilasi / gulpfile.js
Last active March 23, 2017 06:44
This is my gulp file
installations
npm install gulp-concat --save-dev
npm install vinyl-source-stream --save-dev
sudo npm install gulp -g
npm install gulp-uglify
npm install gulp-util --save-dev
npm install del --save-dev
npm install jshint --save-dev
npm install gulp-jshint --save-dev
npm install browser-sync --save-dev