(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| ======= Prolbem ================================================================================================================= | |
| I have installed : ruby-2.0.0,postgres-9.2 , now in rails app when I execute: | |
| rake db:create , command I get: | |
| PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) | |
| HINT: Use the same encoding as in the template database, or use template0 as template. | |
| : CREATE DATABASE "my_db_name" ENCODING = 'unicode'....... | |
| bin/rake:16:in `load' |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| # replace file basename with a UUID when uploaded | |
| # e.g.: avatar.jpg becomes 41bf830f-80cf-4efe-ad90-3b29bc6708b5.jpg | |
| # but don't regenerate a UUID each time file url is accessed | |
| class User < ActiveRecord::Base | |
| has_attached_file :avatar, path: ":basename.:extension" | |
| before_validation { set_avatar_file_name } | |
| def set_avatar_file_name | |
| # replace any NEW filename with a UUID |
To remove a submodule you need to:
| /* | |
| * Random-Number Utilities (randutil) | |
| * Addresses common issues with C++11 random number generation. | |
| * Makes good seeding easier, and makes using RNGs easy while retaining | |
| * all the power. | |
| * | |
| * The MIT License (MIT) | |
| * | |
| * Copyright (c) 2015-2022 Melissa E. O'Neill | |
| * |
On Tue Oct 27, 2015, history.state.gov began buckling under load, intermittently issuing 500 errors. Nginx's error log was sprinkled with the following errors:
2015/10/27 21:48:36 [crit] 2475#0: accept4() failed (24: Too many open files)
2015/10/27 21:48:36 [alert] 2475#0: *7163915 socket() failed (24: Too many open files) while connecting to upstream...
An article at http://www.cyberciti.biz/faq/linux-unix-nginx-too-many-open-files/ provided directions that mostly worked. Below are the steps we followed. The steps that diverged from the article's directions are marked with an *.
su to run ulimit on the nginx account, use ps aux | grep nginx to locate nginx's process IDs. Then query each process's file handle limits using cat /proc/pid/limits (where pid is the process id retrieved from ps). (Note: sudo may be necessary on your system for the cat command here, depending on your system.)fs.file-max = 70000 to /etc/sysctl.confFind the Discord channel in which you would like to send commits and other updates
In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe!
| using System; | |
| using System.Collections.Generic; | |
| using Windows.System; | |
| using Windows.Storage.Streams; | |
| using Windows.Services.Store; | |
| using Windows.Gaming.XboxLive.Storage; | |
| using Microsoft.Xbox.Services; | |
| using Microsoft.Xbox.Services.System; | |
| using Microsoft.Xbox.Services.Presence; | |
| using Microsoft.Xbox.Services.Statistics.Manager; |
| struct Input | |
| { | |
| float2 TexCoord : TEXCOORD0; | |
| float4 Color : TEXCOORD1; | |
| }; | |
| struct Output | |
| { | |
| float4 Color : SV_Target0; | |
| }; |