James Sugrue [asked][1], "@GitHubAPI is there a way to find the number of stars for a given repository?"
$ curl -ni "https://api.github.com/search/repositories?q=more+useful+keyboard" -H 'Accept: application/vnd.github.preview'
{
'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); |
GET /users | |
response: | |
{ | |
data: [ | |
{ | |
id: 1, | |
name: John Doe | |
}, |
var test = require('tape'); | |
test('setup', function (t) { | |
// ... | |
t.end(); | |
}); | |
// tests go here | |
test('teardown', function (t) { |
docker_running=$(docker-machine ls | grep default) | |
if [[ "$docker_running" == *"Stopped"* ]] | |
then | |
docker-machine start | |
eval "$(docker-machine env)" | |
env | grep "DOCKER_HOST" | |
elif [[ "$docker_running" == *"Running"* ]] | |
then | |
eval "$(docker-machine env)" | |
fi |
!#/bin/bash | |
for dirs in ~/Projects/hostel/public_html/assets/reservation/components/*; do | |
if [ -d "$dirs" ]; then | |
for dir in $dirs; do | |
for comp in $dir/*; do | |
if [ -d "$comp" ]; then | |
for pol in $comp/*.jsx; do | |
cd $comp && touch package.json | |
str=${pol##*/} | |
rjsx=${str//.jsx} |
!#/bin/bash | |
for file in *.jsx; do | |
dir=${file%.js*} | |
if [ -e $dir ]; then | |
mv "$file" "$dir" | |
else | |
mkdir -p "$dir" | |
mv "$file" "$dir" | |
fi | |
done |
#!/bin/sh | |
# Config for SSL. | |
echo "--- Making SSL Directory ---" | |
mkdir /etc/nginx/ssl | |
echo "--- Copying $i SSL crt and key ---" | |
openssl req -nodes -new -x509 -keyout /etc/nginx/ssl/server.key -out /etc/nginx/ssl/server.crt -subj "/C=US/ST=NY/L=NYC/O=Dis/CN=www.example.com" | |
echo "--- Turning SSL on in nginx.conf. ---" |
function formatXml(xml) { | |
var formatted = ''; | |
var reg = /(>)(<)(\/*)/g; | |
xml = xml.replace(reg, '$1\r\n$2$3'); | |
var pad = 0; | |
jQuery.each(xml.split('\r\n'), function(index, node) { | |
var indent = 0; | |
if (node.match( /.+<\/\w[^>]*>$/ )) { | |
indent = 0; | |
} else if (node.match( /^<\/\w/ )) { |