Skip to content

Instantly share code, notes, and snippets.

cdesch cdesch

Block or report user

Report or block cdesch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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 / 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 / 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);
@cdesch
cdesch / rails_generator_cheat_sheet.md
Last active Mar 6, 2020
Rails Generator CheatSheet
View rails_generator_cheat_sheet.md

Cheat Sheets are greate but they are not a substitute for learning the framework and reading the documentation as we most certainly have not covered every potential example here. Please refer to the Rails Command Line Docs for more information.

Command Line Generator Info

Reference

You can get all of this information on the command line.

rails generate with no generator name will output a list of all available generators and some information about global options. rails generate GENERATOR --help will list the options that can be passed to the specified generator.

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 / Ruby
Last active Oct 14, 2019
Rails Regex
View Ruby
#regex templates
#Subdomain
#ensure there are no special characters and the subdomain does not end with a - or _
/^[a-z\d]+([-_][a-z\d]+)*$/i
#title
/[a-zA-Z0-9.\s]+/i
# ensure secret contains at least one number
@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() {
View gist:867d8d9a8aa2ae78af64f1d179fec89d
iex(1)> s1 = "Hello, World!"
"Hello, World!"
iex(2)> s2 = "ボリスくん"
"ボリスくん"
iex(3)> Regex.scan(~r/\S/, s1)
[["H"], ["e"], ["l"], ["l"], ["o"], [","], ["W"], ["o"], ["r"], ["l"], ["d"],
["!"]]
iex(4)> Regex.scan(~r/\S/, s2)
[[<<227>>], [<<131>>], [<<156>>], [<<227>>], [<<131>>], [<<170>>], [<<227>>],
[<<130>>], [<<185>>], [<<227>>], [<<129>>], [<<143>>], [<<227>>], [<<130>>],
You can’t perform that action at this time.