Skip to content

Instantly share code, notes, and snippets.

Hack Hat hackhat

Block or report user

Report or block hackhat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hackhat
hackhat / uploadAWSS3FolderWithStructure.js
Last active Sep 12, 2018
Upload folder to AWS.S3 with Node.js (works on windows, keeps the folder structure intact, correct mime type)
View uploadAWSS3FolderWithStructure.js
// Your config file
const s3Config = require('./s3Config');
const AWS = require("aws-sdk");
const fs = require("fs");
const path = require("path");
const mime = require("mime");
const config = {
s3BucketName: s3Config.bucketName,
// Absolute path
@hackhat
hackhat / CSS output from jsxstyle
Created Apr 29, 2015
CSS output from jsxstyle
View CSS output from jsxstyle
.main_0 {
/* C:\apps\jsxstyle\example\main.js:9 */
margin-left:auto;
margin-right:auto;
margin-top:128px;
border:1px solid rgba(10, 0, 0,0.8);
width:384px;
min-height:64px;
display:block;
}
@hackhat
hackhat / CSS output from react-style
Created Apr 29, 2015
CSS output from react-style
View CSS output from react-style
.Button_baseStyle,.Button_baseStyle.Button_baseStyle1,.Button_baseStyle.Button_baseStyle1.Button_baseStyle2,.Button_baseStyle.Button_baseStyle1.Button_baseStyle2.Button_baseStyle3,.Button_baseStyle.Button_baseStyle1.Button_baseStyle2.Button_baseStyle3.Button_baseStyle4,.Button_baseStyle.Button_baseStyle1.Button_baseStyle2.Button_baseStyle3.Button_baseStyle4.Button_baseStyle5,.Button_baseStyle.Button_baseStyle1.Button_baseStyle2.Button_baseStyle3.Button_baseStyle4.Button_baseStyle5.Button_baseStyle6,.Button_baseStyle.Button_baseStyle1.Button_baseStyle2.Button_baseStyle3.Button_baseStyle4.Button_baseStyle5.Button_baseStyle6.Button_baseStyle7,.Button_baseStyle.Button_baseStyle1.Button_baseStyle2.Button_baseStyle3.Button_baseStyle4.Button_baseStyle5.Button_baseStyle6.Button_baseStyle7.Button_baseStyle8,.Button_baseStyle.Button_baseStyle1.Button_baseStyle2.Button_baseStyle3.Button_baseStyle4.Button_baseStyle5.Button_baseStyle6.Button_baseStyle7.Button_baseStyle8.Button_baseStyle9 {
display: inline-block;
zoom:
@hackhat
hackhat / a.js
Created Mar 20, 2015
Reusable services
View a.js
// api/v1/group/a.js
module.exports = function(args, cb, session){
var bRes = this.f_api('v1.group.b', {
a: 5
}).wait();
cb(void 0, {
myData: bRes.someData
});
}
module.exports.fibers = true;
@hackhat
hackhat / spawn.js
Created Mar 20, 2015
Example of a service
View spawn.js
var constants = require('client/constants');
var _ = require('lodash');
var roomIdGenerator = require('client/logic/roomIdGenerator');
/**
* Spawns a new player in the next available block.
You can’t perform that action at this time.