Skip to content

Instantly share code, notes, and snippets.

@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active July 12, 2024 11:15
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@dbankier
dbankier / gist:c0e15ff0babaa878112f
Created May 8, 2014 13:27
Add copyright/license note to the top of all js files
find . -type f | grep -v node_modules | grep -v modules | grep -v .git | grep -v .json | grep .js | xargs -I{} perl -pi -e 'print "/*\n * Copyright (c) 2011-2014 YY Digital Pty Ltd. All Rights Reserved.\n * Please see the LICENSE file included with this distribution for details.\n */\n\n" if $. == 1' {}
@jo
jo / js-crypto-libraries.md
Last active July 11, 2024 17:44
List of JavaScript Crypto libraries.

JavaScript Crypto Libraries

List some crypto libraries for JavaScript out there. Might be a bit out dated. Scroll to the bottom.

WebCryptoAPI

http://www.w3.org/TR/WebCryptoAPI/

This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.

@iskugor
iskugor / localStorage.js
Last active December 28, 2015 06:09
Use parse.com JS API in Titanium mobile
module.exports = {
getItem : function(_key) {
return Ti.App.Properties.getObject(_key);
},
setItem : function(_key, _value) {
return Ti.App.Properties.setObject(_key, _value);
},
removeItem : function(_key, _value) {
return Ti.App.Properties.removeProperty(_key);
}
@mikermcneil
mikermcneil / using-raw-socket-io-in-sails.js
Created September 17, 2013 18:32
Using raw socket.io functionality in a Sails.js controller
module.exports = {
/**
*
* Using raw socket.io functionality from a Sails.js controller
*
*/
index: function (req,res) {
@artanisdesign
artanisdesign / TiUIButton.m
Last active December 19, 2015 22:29
showsTouchWhenHighlighted on Titanium button
-(UIButton*)button
{
if (button==nil)
{
BOOL hasImage = [self.proxy valueForKey:@"backgroundImage"]!=nil;
UIButtonType defaultType = (hasImage==YES) ? UIButtonTypeCustom : UIButtonTypeRoundedRect;
style = [TiUtils intValue:[self.proxy valueForKey:@"style"] def:defaultType];
UIView *btn = [TiButtonUtil buttonWithType:style];
@FokkeZB
FokkeZB / app.js
Created April 19, 2013 08:17
How to decide what window to open first in Titanium Alloy. You can remove all markup from the index.xml view (the file itself must be there!) and then create another controller based on your logic.
/* /Resources/app.js - Generated by Alloy, here to understand the flow */
var Alloy = require("alloy"), _ = Alloy._, Backbone = Alloy.Backbone;
Alloy.createController("index");
@kwhinnery
kwhinnery / titanium_setup.md
Created January 16, 2013 20:52
Installing and using Titanium (for iOS) is now 67% more easy/awesome with the node-based CLI.

Getting Started with Titanium (Redux)

Now that Titanium is starting to have a proper CLI, installing and using Titanium is 67% more awesome. At some of the CLI commands, you will be asked for config information and your Appcelerator login, but these are the high level steps:

  1. Sign up for an account at appcelerator.com
  2. Install node.js
  3. Install Xcode from the Mac App Store
  4. sudo npm install -g titanium
  5. titanium sdk install --default
  6. titanium create
@aaronksaunders
aaronksaunders / InstagramMgr.js
Created September 30, 2012 19:02
Titanium Appcelerator Instagram Code ... This code is almost two years old and I havent tested it in a while
/**
*
* this code was inspired by the work done by David Riccitelli
*
* Copyright 2011 Aaron K. Saunders, Clearly Innovative Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@tonylukasavage
tonylukasavage / search.txt
Created September 11, 2012 15:10
Alloy twitter search
-shears -fibre -fuselage -shuttle -steel -dental -"heart is titanium alloy" -screwdriver -rust -passion -coupe -"lead foot" -aluminum -aluminium -CSPM -suspension -iron -magnesium -shaft -garage -polished -knit -footwear -racket -rims -silver -metal -metallic -gold -needle alloy -wheel -wheels -cosmetic (mobile OR development OR dev OR controller OR backbone OR mvc OR widget OR appcelerator OR titanium OR framework)