Skip to content

Instantly share code, notes, and snippets.

@giorgi568
giorgi568 / gh-pages-deploy.md
Created October 29, 2023 18:14 — 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).

@giorgi568
giorgi568 / histogramW.c
Created July 24, 2024 14:41
the c programming language book, exercise 1-13. word length histogram program.
#include <stdio.h>
#define MAXWORDINPUT 100 /*out program will only handle input of maximum 10 words*/
int main()
{
int c, high, current, place, i, j;
int words[MAXWORDINPUT];
for (i = 0; i < 100; i++)
@giorgi568
giorgi568 / histogramC.c
Created July 24, 2024 17:46
the c programming language book, exercise 1-14. histogram of frequencies of different characters.
#include <stdio.h>
int main()
{
int c, i, j;
int characters[25];
for (i = 0; i < 25; i++)
{
characters[i] = 0;
@giorgi568
giorgi568 / reverseline.c
Created July 25, 2024 16:28
the c programming language book. exercise 1-19.
#include <stdio.h>
#define ARRLEN 1000
int reverse(char s[], int len);
int reverse(char s[], int len)
{
int head, tail;
char temp;
head = 0;
@giorgi568
giorgi568 / entab.c
Created July 29, 2024 18:05
the c programming language exercise 1-21
#include <stdio.h>
#define TABLEN 4
#define ARRLEN 1000
int get_line(char s[], int lim);
/* program for replacing tabs with appropriate number of
blank characters */
@giorgi568
giorgi568 / comrem.c
Created July 29, 2024 18:06
the c programming language exercise 1-23
#include <stdio.h>
#define ARRLEN 1000
#define IN 1 /* in a comment */
#define OUT 0 /* out of a comment */
/* removes comments from c program(only /* style commnets) */
int get_line(char s[], int lim);
int get_line(char s[], int lim)
{
@giorgi568
giorgi568 / htoi.c
Created August 3, 2024 21:53
the c programming language exercise 2-3. (hex to int)
#include <stdio.h>
#include <ctype.h>
int expo(int x, int y);
int atoi(char c);
int htoi(char s[]);
void main() {
printf("%d\n", htoi("62Fa"));
}
@giorgi568
giorgi568 / squeeze.c
Created August 4, 2024 10:55
the c programming language book, exercise 2-4
#include <stdio.h>
/*
this is supposed to remove any character in
string s, which also happens to be in string c
*/
#define IN 1
#define OUT 0
@giorgi568
giorgi568 / any.c
Created August 4, 2024 10:56
the c programming language book, exercise 2-5
#include <stdio.h>
/*
this is supposed to return first location in
string s1 where any character from the string
s2 occurs, or -1 if no such occurances exist.
*/
int any(char s1[], char s2[]);
int any(char s1[], char s2[]){
@giorgi568
giorgi568 / expand.c
Created August 7, 2024 22:20
the c programming language book, exercise 3-3
#include <stdio.h>
void expand(char s1[], char s2[]);
void expand(char s1[], char s2[]) {
int i, j, l;
char start, end;
start = end = '\0';
l = 0;