Skip to content

Instantly share code, notes, and snippets.

View danielmorena's full-sized avatar

Daniel Morena danielmorena

View GitHub Profile
@danielmorena
danielmorena / .gitignore
Created November 19, 2019 15:17 — forked from HipsterBrown/.gitignore
Minimal nw.js app using node-serialport
node_modules/
dist/
@danielmorena
danielmorena / dreamhost-deploy.md
Created November 1, 2019 15:09 — forked from LosAlamosAl/dreamhost-deploy.md
Deploy a GitHub-based static site to Dreamhost

Before begining, make sure your SSH keys are set so you can ssh to your Dreamhost account.

$ ssh-copy-id -i ~/.ssh/id_rsa.pub xxxxxx@cloverdale.dreamhost.com
(you'll need xxxxxx's password here)
$ ssh xxxxxx@cloverdale.dreamhost.com

On the Dreamhost server you should have a directory for your site (e.g. adubdub.com or ispeed.honeyimlost.com (if not, you'll need to make one). You now need to make a git repository for that site (at the same level in the tree) and initialize a bare repo:

@danielmorena
danielmorena / ReCodeSign
Created May 17, 2019 22:58 — forked from 0xc010d/ReCodeSign
Codesign an iOS app, with a different distribution certificate and mobileprovisioning file.
- Copy the delivered ipa into a directory to work in.
- export PlistBuddy="/usr/libexec/PlistBuddy" to get the PlistBuddy tool to your shell. If it is not added, all references to PlistBuddy
will need to be written as the full path.
- Take the delivered App.ipa and unzip it using the unzip command. This should produce a Payload directory containing the app and its
resources.
- Enter the command "codesign -d --entitlements :enterprise.plist Payload/PathToApp.app/" This pulls the entitlements out of the app, and
prints them to a plist, without a leading "blob" of data. Pay particular attention to the colon before the enterprise.plist file name.
@danielmorena
danielmorena / download-images-from-google-drive.js
Created February 7, 2019 20:20 — forked from davestevens/download-images-from-google-drive.js
Download images from Google Drive folder using Node.js Google library
var google = require("googleapis"),
drive = google.drive("v2"),
fs = require("fs");
var config = {
"client_id": "client_id",
"client_secret": "client_secret",
"scope": "scope",
"redirect_url": "redirect_rul",
"tokens": {
@danielmorena
danielmorena / .htaccess
Created October 29, 2018 22:43 — forked from azimidev/.htaccess
The Best .htaccess with browser caching and gzip
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
@danielmorena
danielmorena / git-cheat-sheet.md
Last active October 9, 2018 15:19 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@danielmorena
danielmorena / vanilla-js-cheatsheet.md
Created August 21, 2018 10:11 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@danielmorena
danielmorena / combining.js
Created June 8, 2018 17:52 — forked from gaearon/combining.js
Combining Stateless Stores
// ------------
// counterStore.js
// ------------
import {
INCREMENT_COUNTER,
DECREMENT_COUNTER
} from '../constants/ActionTypes';
const initialState = { counter: 0 };
@danielmorena
danielmorena / encryption.js
Created May 17, 2018 12:43 — forked from vlucas/encryption.ts
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bytes (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', new Buffer(ENCRYPTION_KEY), iv);
// CaptureStackBackTrace
// http://msdn.microsoft.com/en-us/library/windows/desktop/bb204633(v=vs.85).aspx
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
//////////////////////////////////////////////////////////////
void capture() {
const ULONG framesToSkip = 0;
const ULONG framesToCapture = 64;