Skip to content

Instantly share code, notes, and snippets.

View kmullings's full-sized avatar

Keno Mullings kmullings

View GitHub Profile
//atmosphere packages: jparker:crypto-aes , matb33:collection-hooks
var encryptionKey = "adsffe534tryertrrtweGe";
//Before insert Hooks, I decide to use it only in the server. If you use on the client and server, you're encrypting it twice.
Todos.before.insert( function( userId , doc ){
doc.text = CryptoJS.AES.encrypt( doc.text , encryptionKey ).toString();
} );
@joecliff
joecliff / cryptojs_base64_encrypt_decrypt.js
Last active February 14, 2025 08:56
An example of base64 usage in cryptojs
var CryptoJS = require("crypto-js");//replace thie with script tag in browser env
//encrypt
var rawStr = "hello world!";
var wordArray = CryptoJS.enc.Utf8.parse(rawStr);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
console.log('encrypted:', base64);
//decrypt
var parsedWordArray = CryptoJS.enc.Base64.parse(base64);
@wpscholar
wpscholar / functions.php
Last active October 20, 2024 14:01
Enqueueing IE conditional stylesheets in WordPress the right way
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
/**
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE.
* IE10 and up does not support conditional comments in standards mode.
*
* @uses wp_style_add_data() WordPress function to add the conditional data.
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@joelnet
joelnet / example.html
Created June 3, 2011 18:03
Unobtrusive Knockout support library for jQuery
Choose a ticket class: <select id="tickets"></select>
<p id="ticketOutput"></p>
<script id="ticketTemplate" type="text/x-jquery-tmpl">
{{if chosenTicket}}
You have chosen <b>${ chosenTicket().name }</b>
($${ chosenTicket().price })
<button data-bind="click: resetTicket">Clear</button>
{{/if}}
@pmuellr
pmuellr / function-tracer.js
Created September 18, 2009 16:16
have your JavaScript methods trace their execution
//------------------------------------------------------------------------------
// JavaScript function tracer for "classes"
//------------------------------------------------------------------------------
// from: pmuellr@muellerware.org
// home: http://gist.github.com/189144
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// define our function tracer
//------------------------------------------------------------------------------