Skip to content

Instantly share code, notes, and snippets.

View Akhi1's full-sized avatar
🎯
Next big thing

Akhil Akhi1

🎯
Next big thing
View GitHub Profile
$ sudo apt-get update
$ sudo apt-get install unzip wget
$ wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
$ unzip ngrok-stable-linux-amd64.zip
$ sudo mv ./ngrok /usr/bin/ngrok
$ ngrok
@bernardolopes8
bernardolopes8 / BookPersister.java
Last active February 8, 2024 14:46
Jersey Pagination, Sorting, and Filtering Example
package my.application.dao;
import java.util.List;
import my.application.entity.Book;
import my.application.restutil.RequestOptions;
public interface BookPersister {
List<Book> getBooks(RequestOptions requestOptions);
}
@normoes
normoes / java_springboot_mongodb_aggregates.md
Last active June 19, 2024 04:01
mongodb aggregates using MongoRepository in Java spring boot

mongodb aggregates using MongoRepository in Java spring boot


Some prerequisites and assumptions

Use the following dependencies within your pom.xml:

  • spring-boot-starter-parent 1.5.7.RELEASE
  • spring-boot-starter-data-mongodb
@barbietunnie
barbietunnie / udemy-courses-download-using-cookies.md
Last active July 18, 2024 12:14
Downloading Udemy videos with youtube-dl

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}
import java.util.Random;
public class dice {
// Codded by Osanda Malith Jayathissa (@OsandaMalith)
/*
Write a program that simulates the rolling of two dice. The program should use rand to roll the first die and should use rand again to roll the second die. The sum of two values should then be calculated. [Note : Each die can show an integer value from 1 to 6, so the sum of the two values will vary from 2 to 12, with 7 being the most frequent sum and 2 and 12 being the least frequent sums.] Note that there are 36 possible combinations of the two dice. Your program should roll the two dice 3,600 times. Use a one_dimensional array to tally the numbers of times each possible sum appears. Print the results in a tabular format. Also, determine if the totals are reasonable (i.e., there are six ways to roll a 7, so approximately one-sixth of all the rolls should be 7).
http://www.freemathhelp.com/rolling-dice.html
Outcome List of Combinations Total
2 1+1 1
3 1+2, 2+1 2
@Crydust
Crydust / Git.java
Last active July 4, 2024 04:12
run git commands from java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Objects;
@alexpchin
alexpchin / Add_Existing_Project_To_Git.md
Created June 1, 2014 20:14
Add Existing Project To Git Repo

#Adding an existing project to GitHub using the command line

Simple steps to add existing project to Github.

1. Create a new repository on GitHub.

In Terminal, change the current working directory to your local project.

##2. Initialize the local directory as a Git repository.

git init
@jkuipers
jkuipers / formMacros.ftl
Last active June 21, 2022 13:43
FreeMarker macros for rendering Bootstrap horizontal form inputs in Spring-MVC applications
<#ftl strip_whitespace=true>
<#import "spring.ftl" as spring />
<#-- This file contains form-related macros for use in the other Freemarker template files.
The generated HTML is intended for use with Twitter Bootstrap based forms. -->
<#--
* radioButtons
*
* @param path the name of the field to bind to
@richardcornish
richardcornish / git.md
Last active August 11, 2023 08:44
Enough Git for your résumé in 100ish lines
@bcoe
bcoe / upload.js
Created September 1, 2012 22:57
upload.js
var xhr = _this = this,
new XMLHttpRequest(),
fd = new FormData(),
key = this.email + '/' + epoch.toString() + '/' + file.name;
// Populate the Post paramters.
fd.append('key', key);
fd.append('AWSAccessKeyId', 'XXXXXXXXXXXX');
fd.append('acl', 'private');
fd.append('success_action_redirect', "https://attachments.me/upload_callback")