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/bash | |
### BEGIN INIT INFO | |
# Provides: disable-transparent-hugepages | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Disable Linux transparent huge pages | |
# Description: Disable Linux transparent huge pages, to improve | |
# database performance. | |
### END INIT INFO |
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/bash | |
############################################### | |
# To use: | |
# chmod +x install-redis.sh | |
# ./install-redis.sh | |
############################################### | |
version=3.2.0 | |
echo "*****************************************" | |
echo " 1. Prerequisites: Install updates, set time zones, install GCC and make" |
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
{ | |
"beautify.config": { | |
"js": { | |
"e4x": true | |
}, | |
"css": { | |
"selector_separator_newline": true, | |
"newline_between_rules": true, | |
"preserve_newlines": true, | |
"end_with_newline": true |
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
package main | |
import ( | |
"bytes" | |
"encoding/base64" | |
"errors" | |
"github.com/aws/aws-lambda-go/lambda" | |
"github.com/disintegration/imaging" | |
"github.com/nickalie/go-webpbin" | |
"io/ioutil" |
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
/* | |
Usage: | |
const http = json => fetch('http://yourGraphQLEndpoint.com', { | |
method: 'POST', | |
cache: 'no-store', | |
headers: { | |
'content-type': 'application/json' | |
}, | |
body: JSON.stringify(json) |
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
import filter from 'lodash/filter'; | |
import forEach from 'lodash/forEach'; | |
import isFunction from 'lodash/isFunction'; | |
import isString from 'lodash/isString'; | |
export default class Events { | |
constructor(persist) { | |
this._fns = []; | |
} |
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
export function get(fn, defaultValue = null, args) { | |
try { | |
const result = fn(args); | |
return result !== undefined && result !== null ? result : defaultValue; | |
} catch (e) { | |
return defaultValue; | |
} | |
} |
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
// safe object getter setter | |
// get({}, ['prop1', 'prop2], []) | |
// set({}, ['prop1', 'prop2], []) | |
const isString = path => typeof path === 'string'; | |
export function get(object, path, defaultValue = null) { | |
const string = isString(path); | |
const length = path.length; |
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
import _ from 'lodash'; | |
export const degToRad = x => { | |
return x / 180 * Math.PI; | |
}; | |
export const radToDeg = x => { | |
return x / Math.PI * 180; | |
}; |
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
const regex = { | |
headline: /^(#{1,6})([^#\n]+)$/m, | |
hr: /^(?:([*\-_] ?)+)\1\1$/gm, | |
style: /(?:([*_~]{1,3}))([^*_~\n]+[^*_~\s])\1/g | |
}; | |
export default function(str) { | |
let stra; | |
/* headlines */ |