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
require 'package' # include package class file | |
class Vim < Package # name the package and make it a Package class instance | |
version '7.4' # software version | |
source_url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2' # software source tarball url | |
source_sha1 '601abf7cc2b5ab186f40d8790e542f86afca86b7' # source tarball sha1 sum | |
depends_on 'ncurses' # software dependencies | |
def self.build # self.build contains commands needed to build the software from source |
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 frequencies = new Uint8Array(analyser.frequencyBinCount); | |
analyser.getByteFrequencyData(frequencies); | |
for(var i=25; i<=80; ++i) { | |
if(frequencies[i] > 250) document.dispatchEvent(whistleEvent); | |
} |
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
{"level":"info","message":"process type is test_frontend","timestamp":"2013-10-20T19:48:37.935Z"} | |
{"date":"Sun Oct 20 2013 21:48:37 GMT+0200 (CEST)","process":{"pid":10301,"uid":1000,"gid":1000,"cwd":"/home/skycocker/Desktop/browserid","execPath":"/usr/local/bin/node","version":"v0.10.21","argv":["node","/home/skycocker/Desktop/browserid/scripts/test_frontend"],"memoryUsage":{"rss":18509824,"heapTotal":15453568,"heapUsed":7987892}},"os":{"loadavg":[1.8203125,1.7841796875,1.77001953125],"uptime":3959.078639706},"trace":[{"column":11,"file":"child_process.js","function":"errnoException","line":980,"method":null,"native":false},{"column":34,"file":"child_process.js","function":"Process.ChildProcess._handle.onexit","line":771,"method":"ChildProcess._handle.onexit","native":false}],"stack":["Error: spawn ENOENT"," at errnoException (child_process.js:980:11)"," at Process.ChildProcess._handle.onexit (child_process.js:771:34)"],"level":"error","message":"uncaughtException: spawn ENOENT","timestamp":"2013-10-20 |
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
<div id="the-basics"> | |
<input class="typeahead" type="text" placeholder="States of USA"> | |
</div> |
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
sudo fallocate -l 1G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo swapon --show | |
sudo cp /etc/fstab /etc/fstab.bak | |
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab | |
sudo sysctl vm.swappiness=10 | |
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf | |
sudo sysctl vm.vfs_cache_pressure=50 |
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
gem 'google-api-client' |
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 Auth::PasswordsController < DeviseTokenAuth::PasswordsController | |
def edit | |
super | |
# Alamofire tends to ignore Location header in .allHeaderFields, blindly following its contents instead | |
# so we add a new header with the same value | |
# in order to parse it in mobile app | |
response.headers['Alamofire-Location'] = response.headers['Location'] | |
end | |
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
[Definition] | |
failregex = ^<HOST> -.*GET(?!.*\?.*\=) .*(\.php|\.asp|\.exe|\.pl|\.cgi|\.scgi) | |
ignoreregex = |
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
module ImageUploadable | |
extend ActiveSupport::Concern | |
private | |
def set_image_by_params_for(model, params) | |
image_uri = params[:image_uri] | |
image_base64 = params[:image_base64] | |
set_image_from_uri_for(model, image_uri) if image_uri.present? |
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
require 'rails_helper' | |
FactoryBot.factories.each do |factory| | |
describe "The #{factory.name} factory" do | |
it 'is valid' do | |
expect(build(factory.name)).to be_valid | |
end | |
describe 'traits' do | |
factory.defined_traits.each do |trait| |