Skip to content

Instantly share code, notes, and snippets.

Is there an ultimate Makefile?: Part 1 - Applications

Have you ever struggled with writing your Makefile manually or dealing with your projects without depending on a specific IDE? If so, this article is for you to break your chains.

Picture this: a Makefile that adapts to your project like a chameleon, requiring only a few parameter tweaks to fit most of your needs. Gone are the days of wrestling with convoluted build scripts or spending hours integrating external libraries. With this Makefile in your arsenal, you'll conquer the build process with ease and finesse.

Who is this article for?

  • If you have a GNU Linux development environment.
  • If you are using GNU compilers such as g++.
  • If you don't depend on any IDE for project configurations.
@nateheat
nateheat / rescue-grub-with-fedora-live-cd.sh
Last active May 1, 2024 15:01
re-install grub using Fedora Live CD. Fedora was installed with LVM. The system dual boots Ubuntu and Fedora.
su
mkdir /mnt/root
# You may use fdisk -l to list the devices
mount /dev/mapper/fedora-root /mnt/root
# Mount the boot partition, maybe /dev/sda1
# As the system has both Ubuntu and Fedora installed,
# so sda3 in my case
mount /dev/sda<3> /mnt/root/boot
@0xjac
0xjac / private_fork.md
Last active May 1, 2024 14:57
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

using System.Collections.Generic;
/// <summary>
/// Modified Gradient effect script from http://answers.unity3d.com/questions/1086415/gradient-text-in-unity-522-basevertexeffect-is-obs.html
/// -Uses Unity's Gradient class to define the color
/// -Offset is now limited to -1,1
/// -Multiple color blend modes
///
/// Remember that the colors are applied per-vertex so if you have multiple points on your gradient where the color changes and there aren't enough vertices, you won't see all of the colors.
/// </summary>
@jennybc
jennybc / reverse-categorical-axis-ggplot2.r
Created October 10, 2014 01:06
Reverse the order of a categorical axis in ggplot2
scale_x_discrete(limits = rev(levels(the_factor)))
@tykurtz
tykurtz / grokking_to_leetcode.md
Last active May 1, 2024 14:50
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Text to Image Translator</title>
<style>
/* Add any custom CSS styles here */
</style>
</head>
@JustinSDK
JustinSDK / simple_lang.js
Last active May 1, 2024 14:45
simple_lang.js - this gist has evolved into https://github.com/JustinSDK/toy_lang
// === Tokenizer
class Tokens {
constructor(tokens) {
this.head = tokens[0];
this.tail = tokens.slice(1);
}
}
class Tokenizer {
@maiconhellmann
maiconhellmann / ripple_attrs.txt
Created November 21, 2017 16:37
Ripple effect example
android:clickable="true"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground"
@claymcleod
claymcleod / pycurses.py
Last active May 1, 2024 14:44
Python curses example
import sys,os
import curses
def draw_menu(stdscr):
k = 0
cursor_x = 0
cursor_y = 0
# Clear and refresh the screen for a blank canvas
stdscr.clear()