Skip to content

Instantly share code, notes, and snippets.

View joffilyfe's full-sized avatar

Joffily joffilyfe

  • 21:04 (UTC +01:00)
View GitHub Profile
@joffilyfe
joffilyfe / python3_install.sh
Last active December 2, 2017 14:26
Instalação do python 3 no debian 6
#!/bin/sh
clear
message() {
echo "##################################################";
echo "# #";
echo "# INSTALANDO O PYTHON 3.5 #";
echo "# #";
echo "##################################################";
}
@primaryobjects
primaryobjects / mnist.R
Last active September 17, 2018 01:27
MNIST machine learning example in R.
library(caret)
library(doParallel)
# Enable parallel processing.
cl <- makeCluster(detectCores())
registerDoParallel(cl)
# Load the MNIST digit recognition dataset into R
# http://yann.lecun.com/exdb/mnist/
# assume you have all 4 files and gunzip'd them
@deedos
deedos / nginx-rtmp.md
Created July 14, 2015 19:12
Instalação e configuração de nginx-rtmp module e ffmpeg para transcoding

Instalação e Configuração de nginx-rtmp com live transcoding - S.O : Debian SID stable

  • Instalar ffmpeg da fonte: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

  • Instalar nginx com módulo rtmp

      wget http://nginx.org/download/nginx-1.9.3.tar.gz
      git clone https://github.com/arut/nginx-rtmp-module
      wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.bz2
      tar -xvf pcre-8.36.tar.bz2
      tar -xvf nginx-1.9.3.tar.gz
      cd nginx-1.9.3
    
@harlow
harlow / golang_job_queue.md
Last active March 29, 2025 04:55
Job queues in Golang
@sheharyarn
sheharyarn / nginx.overrides
Created June 27, 2015 20:31
Restart / Reload Nginx without Entering Sudo Password
# Enter this command to create a sudoers override/include file:
# sudo visudo -f /etc/sudoers.d/nginx.overrides
# (Make sure you actually have this in your /etc/sudoers - Run `sudo visudo` to check)
# #includedir /etc/sudoers.d
# This file assumes your deployment user is `deploy`
# Nginx Commands
Cmnd_Alias NGINX_RESTART = /usr/sbin/service nginx restart
@moshest
moshest / ecdh.js
Created June 25, 2015 16:50
Node.js v0.12 ECDH Example
var ecdh = crypto.createECDH('secp256k1');
ecdh.generateKeys();
var publicKey = ecdh.getPublicKey(null, 'compressed');
var privateKey = ecdh.getPrivateKey(null, 'compressed');
console.log('Private1:', privateKey.length, privateKey.toString('hex'));
console.log('Public1: ', publicKey.length, publicKey.toString('hex'));
@maxivak
maxivak / readme.md
Last active November 10, 2024 12:19
sitemap.xml for Rails 4 application

Generate sitemap.xml in Rails app

This post shows how to make sitemap.xml for your web site. The sitemap will be accessible by URL http://mysite.com/sitemap.xml

Routes

Myrails::Application.routes.draw do
@hunj
hunj / rdoc_example.rb
Created May 28, 2015 01:09
Ruby RDoc Example
## Found in: http://blog.firsthand.ca/2010/09/ruby-rdoc-example.html
# * Style guide based on Rails documention
module Namespace #:nodoc: don't document this
# Generic Namespace exception class
class NamespaceError < StandardError
end
# Raised when...
@mrbongiolo
mrbongiolo / precompile.md
Last active February 27, 2023 00:16
HOW TO: Rails 4.2 add 'vendor/asset' to precompile list

To enable the precompilation of all non.js/.css assets within vendor/assets just add this to config/initializers/assets.rb:

Rails.application.config.assets.precompile << Proc.new { |path, fn| fn =~ /vendor\/assets/ && !%w(.js .css).include?(File.extname(path)) }

Be aware that this will precompile ALL non .js/.css assets that you have there, some plugins or libraries might have .txt or other files around, and those would end up into your precompiled list also.

If you need to precompile images only, you could use this:

Rails.application.config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif)
@jvenator
jvenator / gist:9672772a631c117da151
Last active April 25, 2025 17:44
PDFtk Server Install Workaround for Mac OS X

Installing PDFtk Server edittion on your Mac

This workaround install is necessary because PDFtk was pulled from homebrew-cask due to issues with it aggressively overwriting file permissions that could impact other installed libraries. See this homebrew-cask issue.
The following steps worked on Mac OS X 10.10.1 with a standard brew installation for the PDFtk Mac OS X server libary version 2.02.
All Terminal commands separated by a full line space. Some commands wrap into multiple lines.

Download and extract the Mac OS X server install pacakge