Skip to content

Instantly share code, notes, and snippets.

View jsheridanwells's full-sized avatar

Jeremy Wells jsheridanwells

View GitHub Profile
@jsdevtom
jsdevtom / README.md
Last active February 6, 2021 13:09
Angular 2 4 5 6 +: Find out if FormControl has required validator with Angular Material example.

Although this pipe is impure, it uses a "Blazing fast" hash in order to check if the AbstractControl has changed at all before calculating whether or not the AbstractControl has a required field.

You will need to install hash-sum like so:

npm i -S hash-sum

@SiddharthaChowdhury
SiddharthaChowdhury / jwt-module.js
Last active July 23, 2024 06:53
Implementation of JWT using private and public keys
const fs = require('fs');
const jwt = require('jsonwebtoken');
// http://travistidwell.com/blog/2013/09/06/an-online-rsa-public-and-private-key-generator/
// use 'utf8' to get string instead of byte array (1024 bit key)
var privateKEY = fs.readFileSync('./private.key', 'utf8'); // to sign JWT
var publicKEY = fs.readFileSync('./public.key', 'utf8'); // to verify JWT
module.exports = {
sign: (payload, $Options) => {
/*
@vmandic
vmandic / dotnet core .gitignore
Last active July 18, 2024 09:03
A default .NET Core project .gitignore file - or just type `dotnet new gitignore`
# From .NET Core 3.0 you can use the command: `dotnet new gitignore` to generate a customizable .gitignore file
*.swp
*.*~
project.lock.json
.DS_Store
*.pyc
# Visual Studio Code
.vscode
@paulredmond
paulredmond / app.js
Last active September 26, 2020 15:03
Example Vue.js mixins for time
import dateMixin from './mixins/date';
// Globally
Vue.mixin(dateMixin);
@mir4ef
mir4ef / save-blob-ctrl.js
Created November 29, 2016 19:31
Save a blob file in AngularJS 1.x
function SaveFileCtrl (SaveFileService) {
var vm = this;
function downloadFile(someArgument) {
SaveFileService.downloadFile({
param: someArgument
}, function (response) {
var fileName = response.headers['content-disposition'].split("=")[1].replace(/\"/gi,'');
var fileType = response.headers['content-type'] + ';charset=utf-8';
var blob = new Blob([response.data], { type: fileType });
void Main()
{
var pushId = FirebasePushIDGenerator.GeneratePushID();
Console.WriteLine(pushId);
Console.WriteLine(FirebasePushIDGenerator.GeneratePushID());
Console.WriteLine(FirebasePushIDGenerator.GeneratePushID());
Thread.Sleep(5);
Console.WriteLine(FirebasePushIDGenerator.GeneratePushID());
Thread.Sleep(5);
Console.WriteLine(FirebasePushIDGenerator.GeneratePushID());
@hfalucas
hfalucas / [1] main.js
Last active June 22, 2024 10:52
[Vue.js] Authentication and Authorization
/**
* Think of this "main.js" file as your application bootstrap.
*/
import Vue from 'vue'
import Resource from 'vue-resource'
import VueRouter from 'vue-router'
import routes from './routes'
import middleware from './middleware'
@aviaryan
aviaryan / zsh-on-windows.md
Last active February 9, 2024 03:22
Installing zsh and oh-my-zsh on Windows
  1. Install zsh from cygwin
  2. Install oh-my-zsh from https://github.com/robbyrussell/oh-my-zsh . Follow the manual instructions
  3. To make zsh default on ConEmu, create a task with C:\cygwin64\bin\mintty.exe /usr/bin/zsh - . Make it the defaut shell.
  4. To start a zsh shell on demand, add this batch script to your path or start menu or wherever.
start C:\cygwin64\bin\mintty.exe /usr/bin/zsh -
@bradonomics
bradonomics / .gitignore
Last active May 6, 2022 20:25
.gitignore file for Jekyll projects
### Jekyll ###
_site
.jekyll-metadata
*-cache/
### NPM ###
/node_modules/
@javierarques
javierarques / protractorAPICheatsheet.md
Last active July 10, 2024 11:24
Protractor API Cheatsheet