Skip to content

Instantly share code, notes, and snippets.

View ComFreek's full-sized avatar
💭
I may be slow to respond.

ComFreek ComFreek

💭
I may be slow to respond.
View GitHub Profile
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 24, 2024 14:17
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@lukas-zech-software
lukas-zech-software / GeoCodingService.ts
Last active April 9, 2021 21:56
Typescript Definitions for official GoogleMaps API for Node.js (https://github.com/googlemaps/google-maps-services-js)
import { createClient, GoogleMapsClient } from '@google/maps';
export class GeoCodingService {
private geoCoder: GoogleMapsClient;
public constructor() {
this.geoCoder = createClient({
key: 'YOUR-API-KEY',
});
@mp4096
mp4096 / ppt2pdf.ps1
Created April 28, 2016 10:56
Batch convert PowerPoint files to PDF
# Batch convert all .ppt/.pptx files encountered in folder and all its subfolders
# The produced PDF files are stored in the invocation folder
#
# Adapted from http://stackoverflow.com/questions/16534292/basic-powershell-batch-convert-word-docx-to-pdf
# Thanks to MFT, takabanana, ComFreek
#
# If PowerShell exits with an error, check if unsigned scripts are allowed in your system.
# You can allow them by calling PowerShell as an Administrator and typing
# ```
# Set-ExecutionPolicy Unrestricted
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@diabloneo
diabloneo / timespec_diff.c
Created March 18, 2014 13:22
Calculate diff of two struct timespec
#include <time.h>
void timespec_diff(struct timespec *start, struct timespec *stop,
struct timespec *result)
{
if ((stop->tv_nsec - start->tv_nsec) < 0) {
result->tv_sec = stop->tv_sec - start->tv_sec - 1;
result->tv_nsec = stop->tv_nsec - start->tv_nsec + 1000000000;
} else {
result->tv_sec = stop->tv_sec - start->tv_sec;
@thomasdarimont
thomasdarimont / LambdaPi.java
Last active December 27, 2015 15:59
Approximate PI in almost one line with Lambdas in Java 8 :) - Theory here: http://www.stealthcopter.com/blog/2009/09/python-calculating-pi-using-random-numbers/
package de.tutorials.training.java8.lambda;
import java.util.stream.IntStream;
import static java.lang.Math.*;
import static java.util.concurrent.ThreadLocalRandom.*;
/**
* Author: Thomas Darimont
*/
@19WAS85
19WAS85 / powershell-web-server.ps1
Last active May 24, 2024 15:47
A simple web server built with powershell.
# This is a super **SIMPLE** example of how to create a very basic powershell webserver
# 2019-05-18 UPDATE — Created by me and and evalued by @jakobii and the comunity.
# Http Server
$http = [System.Net.HttpListener]::new()
# Hostname and port to listen on
$http.Prefixes.Add("http://localhost:8080/")
# Start the Http Server
@isa
isa / MultiLineString.java
Created March 20, 2011 21:47
Demonstrates how you can do multi-line string literals in java.. It's very good especially for unit-testing.
// More info: http://blog.efftinge.de/2008/10/multi-line-string-literals-in-java.html
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
public class MultilineStringDemo {
public static String S() {