Skip to content

Instantly share code, notes, and snippets.

View foxoman's full-sized avatar

Sultan Al Isaiee foxoman

View GitHub Profile
@foxoman
foxoman / foxFileOpen.cpp
Last active August 29, 2015 14:02
OPENING FILE USING CONSTRUCTOR in C++
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ofstream myDB("DB.text");
myDB << "Writing to file using fstream constructor!" << endl;
myDB.close ();
return 0;
@foxoman
foxoman / foxOpenfile2.cpp
Last active August 29, 2015 14:02
OPENING FILE USING CONSTRUCTOR in C++
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
string myDBString;
ifstream myDB("DB.text");
getline(myDB,myDBString); //read the first line
cout << myDBString << endl;
@foxoman
foxoman / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@foxoman
foxoman / hostcmd.sh
Last active December 3, 2020 08:11
Add system hosts file to Network Manager DNSmasq Config:
sudo sh -c "echo 'addn-hosts=/etc/hosts' > /etc/NetworkManager/dnsmasq.d/etc-hosts"
@foxoman
foxoman / ccache.txt
Last active September 18, 2016 01:08
Speeding up compilation on Ubuntu with Qt Creator using ccache
ccache is a clever tool that wraps you compiler (g++ or mpicxx) and understands whether the file you are compiling has been compiled before with exactly the same contents and settings. If it has, it just returns a cached result.
Unlike regular make, ccache is extremely good at detecting the true state of what you are compiling. I have never had any trouble with ccache.
This really speeds up the compilation when you are using make clean, especially if you are switching git branches. In other words, it is a much simpler solution to achieve fast compilation with git branches than to create separate build folders for each branch.
To enable ccache, install it with
sudo apt-get install ccache
and add the following to your .pro file:
@foxoman
foxoman / tcp_bbr.sh
Last active February 21, 2017 11:19 — forked from StoneMoe/tcp_bbr.sh
Enable tcp_bbr for your debian/ubuntu (tested on debian)
#write config
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
#apply config
sysctl -p
#set fq to eth
sudo tc qdisc replace dev eth0 root fq pacing
@foxoman
foxoman / AndroidDevLinux
Created April 22, 2017 15:28 — forked from venkateshshukla/AndroidDevLinux
Setting up your Linux for Android Application Development
Step 1. Preparation
--------------------
First take care of the dependencies for Android Application Development.
Dependencies are -
1. Java
2. ant
3. Eclipse and Android Development tools (IDE)
4. Android SDK and NDK
5. adb
@foxoman
foxoman / README.md
Created September 11, 2017 05:14 — forked from technic/README.md
change font linespacing for dummy editor #linux #ttf #qtcreator

How to change font linespacing

Manual

You need to manipulate a ttf file. I found such a script that comes with Input font at http://input.fontbureau.com. So we copy DejaVuSansMono ttf files to ~/.fonts/ and create a new font DejaVuSansMonoH. I changed line 147, to match this font name, and run

@foxoman
foxoman / ncurses_stl.cpp
Created March 25, 2018 13:21 — forked from daleobrien/ncurses_stl.cpp
A general purpose example of using ncurses in C++ e.g. with STL strings. Note: copied from http://pastebin.com/jRK9C129
/* ncurses C++
*
* A general purpose example of using ncurses in C++ e.g. with STL strings.
* I guess whatever license ncurses uses applies, otherwise public domain.
*/
# include <algorithm>
# include <iostream>
# include <fstream>
# include <iterator>
@foxoman
foxoman / .gitignore
Created March 26, 2018 22:27 — forked from reagent/.gitignore
Curses + C Example
demo
*.swp