Skip to content

Instantly share code, notes, and snippets.

View thedanielforum's full-sized avatar

Daniel Dyrnes thedanielforum

View GitHub Profile
@btxtiger
btxtiger / AesUtil.ts
Last active February 22, 2025 02:18 — forked from AndiDittrich/AesUtil.js
Node.js - AES Encryption/Decryption with AES-256-GCM using random Initialization Vector + Salt
/**
* Cryptography Functions
*
* Forked from AndiDittrich/AesUtil.js
* https://gist.github.com/AndiDittrich/4629e7db04819244e843
*/
import crypto, { CipherGCM, CipherGCMTypes, DecipherGCM } from 'crypto';
import { Password } from './types';
@TerryZ
TerryZ / timezones.json
Last active June 5, 2019 17:53
World time zone
{
"Pacific/Niue": "(GMT-11:00) Niue",
"Pacific/Pago_Pago": "(GMT-11:00) Pago Pago",
"Pacific/Honolulu": "(GMT-10:00) Hawaii Time",
"Pacific/Rarotonga": "(GMT-10:00) Rarotonga",
"Pacific/Tahiti": "(GMT-10:00) Tahiti",
"Pacific/Marquesas": "(GMT-09:30) Marquesas",
"America/Anchorage": "(GMT-09:00) Alaska Time",
"Pacific/Gambier": "(GMT-09:00) Gambier",
"America/Los_Angeles": "(GMT-08:00) Pacific Time",
@ssomnoremac
ssomnoremac / get_schema.js
Created December 8, 2017 03:10
get your graphql schema
var fetch = require('node-fetch');
var fs = require('fs');
const {
buildClientSchema,
introspectionQuery,
printSchema,
} = require('graphql/utilities');
console.log(introspectionQuery);
@veganista
veganista / file.liquid
Created April 20, 2016 10:56
Debugging Objects in Shopify Templates
<script>console.log({{ product | json }});</script>
@stupidbodo
stupidbodo / cron.go
Last active November 3, 2020 18:15
Golang - Keep more than 1 program running forever (similar to cron job but shorter interval)
package main
import (
"fmt"
"runtime"
"time"
)
var (
INTERVAL_SEC = 10
@msikma
msikma / rfc5646-language-tags.js
Created February 26, 2015 13:51
RFC 5646 Language Tags
// List of language tags according to RFC 5646.
// See <http://tools.ietf.org/html/rfc5646> for info on how to parse
// these language tags. Some duplicates have been removed.
var RFC5646_LANGUAGE_TAGS = {
'af': 'Afrikaans',
'af-ZA': 'Afrikaans (South Africa)',
'ar': 'Arabic',
'ar-AE': 'Arabic (U.A.E.)',
'ar-BH': 'Arabic (Bahrain)',
'ar-DZ': 'Arabic (Algeria)',
@stupidbodo
stupidbodo / aes_encryption.go
Last active February 20, 2025 12:09
AES Encryption Example in Golang
// Playbook - http://play.golang.org/p/3wFl4lacjX
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@simonista
simonista / .vimrc
Last active March 30, 2025 10:15
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on