Skip to content

Instantly share code, notes, and snippets.

Avatar

cdesch cdesch

View GitHub Profile
View NginxConfig
upstream phoenix_upstream {
server 127.0.0.1:4000;
}
server {
listen 80;
server_name espresso.kickinespresso.com;
return 301 https://$server_name$request_uri;
}
@cdesch
cdesch / webpacker.yml
Created Mar 31, 2020
Webpacker error webpacker.yml
View webpacker.yml
# Note: You must restart bin/webpack-dev-server for changes to take effect
default: &default
source_path: app/javascript
source_entry_path: packs
public_root_path: public
public_output_path: packs
cache_path: tmp/cache/webpacker
check_yarn_integrity: false
webpack_compile_output: false
@cdesch
cdesch / config-webpack-environment.js
Last active Mar 31, 2020
Webpacker Deployment error
View config-webpack-environment.js
const { environment } = require('@rails/webpacker')
const webpack = require('webpack')
// const customConfig = require('./custom')
// environment.config.merge(customConfig)
// module.exports = environment
environment.plugins.prepend(
'Provide',
@cdesch
cdesch / gist:c21b6d52dff4a0472fe87a2530ecaf8b
Created Mar 11, 2020
FireBird Issue DNET-931 - Console Output
View gist:c21b6d52dff4a0472fe87a2530ecaf8b
/* http://tracker.firebirdsql.org/browse/DNET-931 */
/* Output of the console */
Hello World!
Listening...
info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
Entity Framework Core 2.1.2-rtm-30932 initialized 'MyContext' using provider 'EntityFrameworkCore.FirebirdSql' with options: None
@cdesch
cdesch / DNET-931.sql
Last active Mar 11, 2020
FireBird Issue DNET-931 - SQL Script
View DNET-931.sql
/* http://tracker.firebirdsql.org/browse/DNET-931 */
/* Script */
CREATE DATABASE 'C:\data\demo.fdb' page_size 8192
user 'SYSDBA' password 'masterkey';
CONNECT "C:\data\demo.fdb"
user 'SYSDBA' password 'masterkey';
create table demo (id int primary key, foobar varchar(20) character set utf8);
View gist:343ca5581e33253a4a0270a54c6950d7
https://www.geeksforgeeks.org/python-virtual-environment/
$ virtualenv -p /usr/bin/python3 virtualenv_name
$ source virtualenv_name/bin/activate
View gist:19705f2bebdcce143c1fcd8907496955
This file has been truncated, but you can view the full file.
2001 silly pacote range manifest for @types/istanbul-reports@^1.1.1 fetched in 50ms
2002 silly resolveWithNewModule @types/istanbul-reports@1.1.1 checking installable status
2003 http fetch GET 304 https://registry.npmjs.org/@types%2fistanbul-lib-coverage 54ms (from cache)
2004 silly pacote version manifest for @types/istanbul-lib-coverage@2.0.1 fetched in 55ms
2005 silly resolveWithNewModule @types/istanbul-lib-coverage@2.0.1 checking installable status
2006 http fetch GET 304 https://registry.npmjs.org/@types%2fyargs 55ms (from cache)
2007 silly pacote range manifest for @types/yargs@^13.0.0 fetched in 57ms
2008 silly resolveWithNewModule @types/yargs@13.0.3 checking installable status
2009 http fetch GET 304 https://registry.npmjs.org/@types%2fistanbul-lib-report 35ms (from cache)
@cdesch
cdesch / errorHandlerEx.js
Created Oct 6, 2019
ReactNative ErrorHandling Example - From Expo.io
View errorHandlerEx.js
const defaultHandler = (ErrorUtils.getGlobalHandler && ErrorUtils.getGlobalHandler()) || ErrorUtils._globalHandler;
const customErrorHandler = async (err, isFatal) => {
await AsyncStorage.setItem('lastError', JSON.stringify(err, Object.getOwnPropertyNames(err)));
return defaultHandler(err, isFatal);
};
ErrorUtils.setGlobalHandler(customErrorHandler);
//inside the App component:
async componentWillMount() {
@cdesch
cdesch / numeric.rb
Created Aug 17, 2018
Rails Numeric
View numeric.rb
def is_numeric?(obj)
obj.to_s.match(/\A[+-]?\d+?(\.\d+)?\Z/) == nil ? false : true
end
def is_not_numeric?(obj)
!is_numeric?(obj)
end
View simple form inputs
https://github.com/plataformatec/simple_form/pull/531
<%= f.input :field, :wrapper_html => {class: "input-prepend input-append"} do %>
<span class="add-on">$</span>
<%= f.input_field :field %>
<span class="add-on">%</span>
<% end %>
You can’t perform that action at this time.