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 | |
#### Description: downloads and installs gcc 6.3.0 locally | |
GCC_VERSION=6.3.0 | |
INSTALLDIR="${HOME}/.local" | |
WORKDIR="${HOME}/src" | |
SRCDIR="${WORKDIR}/gcc-${GCC_VERSION}" | |
OBJDIR="${WORKDIR}/objdir" | |
# setup folders |
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
#### Description: downloads and installs python 3.5.2 locally | |
PYTHON_VERSION=3.5.2 | |
PREFIX=$HOME/.local | |
WORK_DIR=$HOME/src | |
TMP_DIR=$HOME/tmp/python | |
LD_RUN_PATH=$PREFIX/lib | |
SRC_DIR=$WORK_DIR/Python-${PYTHON_VERSION} |
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
#!/usr/bin/env bash | |
# run this script from your home folder | |
# sudo bash | |
curl -O http://downloads.mongodb.org/linux/mongodb-linux-x86_64-2.6.12.tgz | |
tar -zxvf mongodb-linux-x86_64-2.6.12.tgz | |
cp mongodb-linux-x86_64-2.6.12/bin/* /usr/local/bin | |
groupadd mongodb | |
useradd --system --no-create-home -g mongodb mongodb |
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 ArticleImageUploader < ImageUploader | |
process :fix_exif_rotation | |
process :strip | |
process :convert => 'jpg' | |
process :quality => 85 # Percentage from 0 - 100 | |
version :gallery_thumb do | |
process :resize_to_fill => Settings.images.article_images.processing.gallery_thumb #44x44 | |
end |
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
#!/usr/bin/env python3 | |
import os | |
import sys | |
if __name__=="__main__": | |
if len(sys.argv) > 1: | |
path = sys.argv[1] | |
else: | |
sys.exit("The folder path is required") |
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
pubnub = Pubnub.new(subscribe_key: ENV['PUBNUB_SUBSCRIBE_KEY'], publish_key: ENV['PUBNUB_PUB_KEY'], uuid: ENV['PUBNUB_SITE_UUID']) | |
pubnub.set_channel_metadata(channel: 'sparkxyz', metadata: { name: 'sparkxyz', description: 'Spark XYZ Chat', custom: { workspace: 'sparkxyz' } }, include: { custom: true }, http_sync: true) do |envelope| | |
puts envelope.inspect | |
end | |
<<-DOC | |
#<Pubnub::ErrorEnvelope:0x00007fa4ebbbcfa0 @id="bf39553e-8f30-411f-9700-b83bed104d63", @event=:set_channel_metadata, @event_options={:channel=>"sparkxyz", :metadata=>{:name=>"sparkxyz", :description=>"Spark XYZ Chat", :custom=>{:workspace=>"sparkxyz"}}, :include=>{:custom=>true}, :http_sync=>true, :callback=>#<Proc:0x00007fa4f45b2200 (pry):8>}, @status={:code=>408, :operation=>:set_channel_metadata, :client_request=>#<URI::HTTP http://ps.pndsn.com/v2/objects/sub-c-fd0dbd48-dd33-11eb-8c90-a639cde32e15/channels/sparkxyz?include=1&pnsdk=PubNub-Ruby%2F4.6.2&uuid=7b046cc45ba6fce276e542a88a4715ea170be9221f27910098f8565aea4dc1cae4de0cdeac54821bd5acaf6 |