Skip to content

Instantly share code, notes, and snippets.

View asidpulse's full-sized avatar

asidpulse asidpulse

  • Monroe, LA
View GitHub Profile
@yoavniran
yoavniran / simple-nodejs-iv-encrypt-decrypt.js
Last active January 20, 2022 08:16
nodejs crypto - simple encrypt & decrypt using IV (Initialization Vector)
"use strict";
var crypto = require("crypto");
var EncryptionHelper = (function () {
function getKeyAndIV(key, callback) {
crypto.pseudoRandomBytes(16, function (err, ivBuffer) {
var keyBuffer = (key instanceof Buffer) ? key : new Buffer(key) ;
@erans
erans / encrypt_decrypt_example.js
Last active October 14, 2022 02:31
Example of encryption and decryption in node.js
var crypto = require("crypto")
function encrypt(key, data) {
var cipher = crypto.createCipher('aes-256-cbc', key);
var crypted = cipher.update(data, 'utf-8', 'hex');
crypted += cipher.final('hex');
return crypted;
}
// number to string, pluginized from http://stackoverflow.com/questions/5529934/javascript-numbers-to-words
window.num2str = function (num) {
return window.num2str.convert(num);
}
window.num2str.ones=['','one','two','three','four','five','six','seven','eight','nine'];
window.num2str.tens=['','','twenty','thirty','forty','fifty','sixty','seventy','eighty','ninety'];
window.num2str.teens=['ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen'];
@travishoglund
travishoglund / Dreamweaver Tip
Created September 11, 2013 03:51
Remove Blank Lines Dreamweaver
Open the file
Click CTRL + F
Select "Current document" in "Find in" (You can also select the folder if you have multiple files)
Search in "Source code"
Tick "Use regular expression"
Type "[\r\n]{2,}" (without quotes) in "Find"
Type "\n" (without quotes) in "Replace"
Press "Replace All"
//This removes all blank lines in Dreamweaver.
@willurd
willurd / web-servers.md
Last active May 4, 2024 07:22
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active May 3, 2024 17:56
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@crtr0
crtr0 / client.js
Created June 8, 2012 17:02
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@h3xx
h3xx / wiki-100k.txt
Created March 5, 2012 03:07
Wictionary top 100,000 most frequently-used English words [for john the ripper]
#!comment: This is a list of the top 100,000 most frequently-used English words
#!comment: according to Wiktionary.
#!comment:
#!comment: It was compiled in August 2005 and coalesced into a handy list for
#!comment: use in John the Ripper.
#!comment:
#!comment:
#!comment: Pull date: Sun Jan 15 22:03:54 2012 GMT
#!comment:
#!comment: Sources:
@gudbergur
gudbergur / gist:1426081
Created December 3, 2011 04:50
Very bare Embed.ly plugin for TinyMCE
// Requirements: jQuery
// Installation: Add this to your tinyMCE.init, put in your button image and your Embed.ly key and you're good to go
// This is just a very simple embed.ly button cause Google turned up squat.
setup : function(ed) {
ed.addButton('myembedly', {
title : 'Embed.ly',
image : 'BUTTON IMAGE',
onclick : function() {
var url = prompt("Enter URL to embed");
if (url == null) return;