Skip to content

Instantly share code, notes, and snippets.

View allybee's full-sized avatar

Allyson Beckers allybee

  • Principal Software Engineer @thenerdery
  • MN
  • 18:51 (UTC -05:00)
View GitHub Profile
@SiddharthaChowdhury
SiddharthaChowdhury / jwt-module.js
Last active February 21, 2024 14:51
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) => {
/*
@jjcarey
jjcarey / 00-SMACSS-README.md
Last active December 6, 2017 22:15
Scalable and Modular Architecture for CSS

Scalable and Modular Architecture for CSS

My Version of the popular CSS architecture.

  • Originally published: June 7, 2015
  • Revised date: April 21, 2016

Summary:

@sumpygump
sumpygump / lsaber
Last active May 16, 2020 18:04
ASCII Lightsaber
#!/bin/bash
######################################################################
# The ASCII lightsaber #
# #
# By: Jansen Price <jansen.price@gmail.com> #
# November 19, 2015 #
# ▁▁▁▁▁▁▁▁▁▁▁▁▁ ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ #
# |▍░▐░░▣░▒░▒░▒▕| ▌ #
# ▔▔▔▔▔▔▔▔▔▝▔▔▔ ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ #
@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@pgilad
pgilad / Instructions.md
Last active March 31, 2024 22:30
Git commit-msg hook to validate for jira issue or the word merge

Instructions

  • copy the file commit-msg to .git/hooks/commit-msg
  • make sure your delete the sample file .git/hooks/commit-msg.sample
  • Make commit msg executable. chmod +x .git/hooks/commit-msg
  • Edit commit-msg to better fit your development branch, commit regex and error message
  • Profit $$

Shell example

@koenpunt
koenpunt / chosen-bootstrap.css
Last active March 11, 2023 01:01
Bootstrap 3.0 theme for Chosen
select.form-control + .chosen-container.chosen-container-single .chosen-single {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: #555;
vertical-align: middle;
background-color: #fff;
@iepathos
iepathos / Chrome and Django favicon fix
Last active October 4, 2022 17:06
Fix for Google Chrome favicon loading in Django. You may have noticed that Chrome has issues loading the appropriate favicon on Django if you have it in a different path other than just '/favicon.ico'. Firefox follows the template icon links no problem, but Chrome needs a little more help. I fixed this issue by adding this quick line to the urls…
#urls.py
from django.conf import settings
urlpatterns = patterns('',
url(r'^favicon.ico/$', lambda x: HttpResponseRedirect(settings.STATIC_URL+'ico/favicon.ico')), #google chrome favicon fix
)
# base.html
<link rel="shortcut icon" href="{{ STATIC_URL }}ico/favicon.ico">
@nickawalsh
nickawalsh / icons.sass
Last active October 7, 2021 09:38
Auto Hi-res Sprites
@import compass
$icons: sprite-map("icons/*.png")
$icons-hd: sprite-map("icons-hd/*.png")
i
background: $icons
display: inline-block
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi)
background: $icons-hd
@JeffreyWay
JeffreyWay / gist:1525217
Created December 27, 2011 21:29
Instant Server for Current Directory
alias server='open http://localhost:8000 && python -m SimpleHTTPServer'
@buhrmi
buhrmi / gist:1344659
Created November 7, 2011 10:51
Sublime Text 2 Git Annotation Colors
<dict>
<key>name</key>
<string>Git Modified Line</string>
<key>scope</key>
<string>git.changes.x</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#272852</string>
</dict>