Skip to content

Instantly share code, notes, and snippets.

View freakynit's full-sized avatar

Nitin Bansal freakynit

View GitHub Profile
@freakynit
freakynit / LetsEncrypt.md
Created May 24, 2017 11:29 — forked from davestevens/LetsEncrypt.md
Let’s Encrypt setup for Apache, NGINX & Node.js

Let's Encrypt

Examples of getting certificates from Let's Encrypt working on Apache, NGINX and Node.js servers.

Obtain certificates

I chose to use the manual method, you have to make a file available to verify you own the domain. Follow the commands from running

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt

Keybase proof

I hereby claim:

  • I am freakynit on github.
  • I am freakynit (https://keybase.io/freakynit) on keybase.
  • I have a public key ASC547gzzrHjkkBPb-L9g2dY3-FKdaiDcv54Mhe1u7kboAo

To claim this, I am signing this object:

@freakynit
freakynit / spectre.c
Created January 11, 2018 18:48 — forked from ErikAugust/spectre.c
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
// ref.: https://medium.freecodecamp.org/node-js-streams-everything-you-need-to-know-c9141306be93
var stream = require('stream');
var Writable = stream.Writable;
var Readable = stream.Readable;
var Duplex = stream.Duplex;
var Transform = stream.Transform;
function consoleWriterStream(){
var writeStream = new Writable({
@freakynit
freakynit / main.go
Created November 28, 2021 03:14
Iterate string containing emoji with skin tone modifier (not working)...
package main
import (
"fmt"
)
func main() {
var s string = "h👍🏻e"
for i, c := range []rune(s) {
fmt.Println(i, string(c))
package main
import (
"fmt"
"time"
)
func testMakeSlice(numIterations int, numRuns int){
a := make([]int32, 0)
for k := 0; k < numRuns; k++ {
@freakynit
freakynit / readMemStatsExample.go
Created November 29, 2021 04:08
Example usage of runtime.ReadMemStats function
package main
import (
"fmt"
"runtime"
"strconv"
"time"
)
func printMemStats(message string, rtm runtime.MemStats){
@freakynit
freakynit / pocket_exporter.js
Created March 28, 2022 06:45
Exports pocket items as csv compatible with raindrop.io. Exported fields: 'url', 'folder', 'title', 'description', 'tags', 'created'
import axios from 'axios'
import {createArrayCsvWriter as createCsvWriter} from 'csv-writer'
// Add your consumer key and access token.
const pocketConsumerKey = '';
const pocketAccessToken = '';
const pocketItemsFilePath = './pocket_items.csv';
const axiosConfig = {
'headers': {
const {
DuckDBBitValue,
DuckDBBlobValue, DuckDBDateValue, DuckDBDecimalValue,
DuckDBIntervalValue, DuckDBListType,
DuckDBListValue, DuckDBMapType,
DuckDBMapValue, DuckDBStructType,
DuckDBStructValue,
DuckDBTimestampMillisecondsValue,
DuckDBTimestampNanosecondsValue,
DuckDBTimestampSecondsValue,
@freakynit
freakynit / get_subtitle_files.js
Created February 12, 2025 09:53 — forked from dansleboby/get_subtitle_files.js
Suno.com Aligned Words Fetcher to SRT or LRC file
// ==UserScript==
// @name Suno Aligned Words Fetcher with Auth
// @namespace http://tampermonkey.net/
// @version 1.2
// @description Fetch aligned words with auth and add a button under the image on Suno pages.
// @author Your Name
// @match https://suno.com/song/*
// @grant none
// ==/UserScript==