Skip to content

Instantly share code, notes, and snippets.

View rebotak's full-sized avatar
🌴
On vacation

Alphaiz Ainurrofiq rebotak

🌴
On vacation
View GitHub Profile
@SuperZikoure
SuperZikoure / apple_mobile_devices_hardware_strings.txt
Last active July 20, 2023 08:26
Apple Mobile Devices Hardware Strings
// Date : 28/05/2021
// Last Updated : 04/05/2022
// Author : Ghassane SEBAÏ
// Contact : ghassane.sebai@gmail.com
// Source : https://en.wikipedia.org/wiki/List_of_iOS_and_iPadOS_devices
// Format :
// "Model Name : [Hardware Strings]"
// -> Using '/' as a separator between hardware strings.
@jheddings
jheddings / ex-notes.py
Last active May 17, 2024 14:20
Import Apple Notes into Notion.
#!/usr/bin/env python3
# !! NOTE - this script is no longer maintained... please see the repo for further
# updates: https://github.com/jheddings/notes2notion
# this script attempts to migrate from Apple Notes to Notion while retaining as
# much information and formatting as possible. there are limitations to the
# export data from Notes, so we try to preserve the intent of the original note.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
@emilpriver
emilpriver / sitemap.xml.js
Created February 3, 2020 19:26
NextJS Sitemap example using Nextjs SSR.
import React from "react";
import axios from "axios";
const sitemapXml = data => {
let latestPost = 0;
let projectsXML = "";
data.map(post => {
const postDate = Date.parse(post.modified);
if (!latestPost || postDate > latestPost) {
@leodutra
leodutra / -setup-windows-wsl-devenv.md
Last active July 20, 2024 20:44
Install and Setup Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font

Setup Windows Subsystem 2 for Linux

Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font

To setup native Linux, see this gist

Preview

Requirements

@victorS7P
victorS7P / spacers.scss
Last active March 3, 2021 02:41
padding and margin bootstrap based helpers
$positions: (
t: ('top'),
r: ('right'),
b: ('bottom'),
l: ('left'),
x: ('left', 'right'),
y: ('top', 'bottom')
);
@mixin sizeValue($prop, $i) {
@a-barbieri
a-barbieri / README.md
Last active June 6, 2021 21:48
NextJS sitemap generator with dynamic URL

NextJS sitemap generator

Install

The current setup has been tested on Next Js 7.0.0.

You need to install Axios.

$ npm install axios
@siwalikm
siwalikm / aes-256-cbc.js
Last active July 23, 2024 02:26
AES-256-CBC implementation in nodeJS with built-in Crypto library
'use strict';
const crypto = require('crypto');
const ENC_KEY = "bf3c199c2470cb477d907b1e0917c17b"; // set random encryption key
const IV = "5183666c72eec9e4"; // set random initialisation vector
// ENC_KEY and IV can be generated as crypto.randomBytes(32).toString('hex');
const phrase = "who let the dogs out";
var encrypt = ((val) => {
@brettscott
brettscott / aes-256-cbc-test.js
Last active March 25, 2024 03:44
AES 256 CBC encryption between Golang and Node JS
// Node v6.9.0
//
// TEST FILE (cut down for simplicity)
// To ensure Golang encrypted string can be decrypted in NodeJS.
//
let crypto;
try {
crypto = require('crypto');
@remy
remy / next.config.js
Created July 18, 2017 18:37
Next.js configuration for dotenv and custom servers.
const webpack = require('webpack');
require('dotenv').config({
path: process.env.NODE_ENV === 'production' ? '.env.production' : '.env'
});
module.exports = {
webpack: config => {
const env = Object.keys(process.env).reduce((acc, curr) => {
acc[`process.env.${curr}`] = JSON.stringify(process.env[curr]);
@gsanders5
gsanders5 / example.nginx
Last active July 16, 2024 19:29
Automatic nginx virtual subdomains with sub-folders or sub-directories
# Automatic nginx virtual subdomains with sub-folders or sub-directories
#
# Since the original source where I found this code is now offline, I have decided to mirror it here.
# All credit goes to: http://web.archive.org/web/20150307193208/http://www.messaliberty.com/2010/10/automatic-nginx-virtual-subdomains-with-sub-folders-or-sub-directories
#
# Description: In my web root directory I wanted create a folder called photos, and another called
# music using a sftp program. Without manually going back to the config file or to the shell I like to
# be able to access them at photos.nginxdomain.com and music.nginxdomain.com. That is what this config does.
# Redirect visitors from http://nginxdomain.com/ to http://www.nginxdomain.com/