var Base64 = {
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
encode: function(input) {
var output = "";
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
var i = 0;
input = Base64._utf8_encode(input);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[git][1] and GitHub have revolutionized not only how I do development, but how we developers share code. | |
I have two tools I need to do software development: an editor and version control. | |
[The Pragmatic Programmer][2] advocates you should know your editor inside and out. So why don't you know your version control system just as well? | |
Hello everyone, today I am demonstrating a little new feature of GITHub that everyone must know about and that feature is **git add patch mode**. | |
Now I know you are familiar with `>git add` the command that takes an entire file and adds it to the staging area, allowing it to be the part of your commit. | |
But patch mode is a way to stage only parts of the change file instead of the entire one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GitHub | |
class << self | |
def download_file_to_string(github_token, setup={}, raw=true, link=nil) | |
if link | |
url = link | |
else | |
sql_repo_name = setup['repo_name'] | |
sql_repo_owner = setup['repo_owner'] | |
# URI join won't make it: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DOCKER | |
## . | |
## ## ## == | |
## ## ## ## === | |
/""""""""""""""""\___/ === | |
~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~ | |
\______ o __/ | |
\ \ __/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
// Adds whitespace to image at left and right in case of portrait to make it appear as landscape | |
// Based on FB Image Size for posts shared with app | |
// Make sure to unlink once done. | |
// Uploads Images to S3 | |
uploadImage: function (req, res) { | |
'use strict'; | |
req.files.image = req.files.Filedata || req.files.image || req.files.files[0]; | |
var image = req.files.image; | |
var fb_cross = req.headers['fb_cross'] || '1'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require("express"); | |
var app = express(); | |
app.get('/', function (req, res) { | |
res.send("This is the '/' route in ep_app"); | |
}); | |
module.exports = app; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= AsciiDoc Article Title | |
Firstname Lastname <[email protected]> | |
1.0, July 29, 2014, Asciidoctor 1.5 article template | |
:toc: | |
:icons: font | |
:quick-uri: http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/ | |
Content entered directly below the header but before the first section heading is called the preamble. | |
== First level heading |
Standard practices say no non-root process gets to talk to the Internet on a port less than 1024. How, then, could I get Node talking on port 80 on EC2? (I wanted it to go as fast as possible and use the smallest possible share of my teeny tiny little micro-instance's resources, so proxying through nginx or Apache seemed suboptimal.)
Alter the port the script talks to from 8000 to 80:
}).listen(80);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create Couchbase Views on the fly | |
* v1.0.0 June 15, 2016 | |
* Dipesh Bhardwaj | |
* Code Style - ES6 Javascript | ES Lint | AirBnB Arrow Functions | |
* This script contains example for sample beer bucket, which comes | |
* pre-loaded with Couchbase. | |
* Create a `startupCheck.js` script in your application, if not already exist | |
* and call this script through it to create all your Couchbase views | |
* during app initialization. This script first checks if the views are already |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This is a skeleton of a bash daemon. To use for yourself, just set the | |
# daemonName variable and then enter in the commands to run in the doCommands | |
# function. Modify the variables just below to fit your preference. | |
daemonName="DAEMON-NAME" | |
pidDir="." | |
pidFile="$pidDir/$daemonName.pid" |