Skip to content

Instantly share code, notes, and snippets.

View IamLizu's full-sized avatar
:octocat:

S M Mahmudul Hasan IamLizu

:octocat:
View GitHub Profile
@IamLizu
IamLizu / hello-world.c
Last active January 13, 2018 11:39
A simple C program to display Hello World!
#include<stdio.h>
int main()
{
printf("Hello World!");
return 0;
}
@IamLizu
IamLizu / add-two-integers.c
Last active January 20, 2018 08:37
C Program to add two integer
#include <stdio.h>
int main()
{
int firstNumber, secondNumber, sumOfTwoNumbers;
printf("Enter two integers: ");
scanf("%d %d", &firstNumber, &secondNumber);
sumOfTwoNumbers = firstNumber + secondNumber;
@IamLizu
IamLizu / array.c
Created January 26, 2018 13:15
Example of a simple array that contains integer value
#include<stdio.h>
int main()
{
int i,s, GivenArray[100];
printf("Enter the size of array : ");
scanf("%d",&s);
printf("Enter elements of the array...\n");
for(i=0;i<s;i++)
{
scanf("%d",&GivenArray[i]);

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}
@IamLizu
IamLizu / WP-HTML-Compression
Created May 2, 2018 19:52 — forked from sethbergman/WP-HTML-Compression
Minify HTML for WordPress without a Plugin - Add to function.php
<?php
class WP_HTML_Compression
{
// Settings
protected $compress_css = true;
protected $compress_js = true;
protected $info_comment = true;
protected $remove_comments = true;
// Variables
# Allow access if Flarum is installed in a subdirectory,
# but another .htaccess in a higher directory denies access.
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
Order Allow,Deny
Allow from all
</IfModule>
@IamLizu
IamLizu / search.sh
Last active March 20, 2019 14:23
A simple shell script that search a specified directory for a term inside the files, the script has the ability to limit the results.
# Author: S M Mahmudul Hasan
# Website: https://www.iamlizu.com
# Programming Forum - https://discuss.codepractice.net
# Email: hasan@codepractice.net
# Syntax: ./search [filepath - the location of the dir] [term - the keyword you want to search] [limit - integer to limit results]
#!/bin/sh
filepath="$1" #here assigning a veriable is not necessary rather not suggested.
string="$2" # "
public class Singleton {
// holds instance of the singleton class
private static Singleton Instance;
public String text;
// private constructor
private Singleton (String text) {
this.text = text;
}
public class main {
public static void main(String[] args) {
System.out.println("Demonstrates Singleton class. Output of the two print statement bellow will be same,");
System.out.println("because the class returned the cached instance of the second call.");
// Initializing one instance of the singleton class
Singleton one = Singleton.getInstance("One");
// Inilializing another instance of singleton class
Singleton two = Singleton.getInstance("Two");
@IamLizu
IamLizu / singleton-c#
Last active September 29, 2019 18:41
using System;
namespace OOP.Singleton
{
class Singleton
{
// holds the singleton instance
private static Singleton Instance;
public string text;