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
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 %>
View operators_domain_scrape.rb
require 'rubygems'
require 'mechanize'
require 'uri'
require 'csv'
#this script looks up vendors from a seed file and creates a new seed file with the domain
# using the first google search result returned
def get_host_without_www(url)
uri = URI.parse(url)
uri = URI.parse("http://#{url}") if uri.scheme.nil?
View vscode config
{
"files.autoSave": "onFocusChange",
"editor.tabSize": 2,
"workbench.colorTheme": "Solarized Dark",
"editor.multiCursorModifier": "ctrlCmd",
"editor.formatOnPaste": true,
"editor.rulers": [
80
],
"ruby.lint": {
View digitalnote
2018-01-07
aws s3 cp p2pstate.bin s3://digitalnotewallet/2018-01-07/p2pstate.bin
aws s3 cp blockchainindices.dat s3://digitalnotewallet/2018-01-07/blockchainindices.dat
aws s3 cp blockindexes.dat s3://digitalnotewallet/2018-01-07/blockindexes.dat
aws s3 cp blocks.dat s3://digitalnotewallet/2018-01-07/blocks.dat
aws s3 cp blockscache.dat s3://digitalnotewallet/2018-01-07/blockscache.dat
@cdesch
cdesch / SQL SAmple Data insert
Created Mar 19, 2018
timescale Timeseries example
View SQL SAmple Data insert
Sample Data SQL Insert
CREATE TABLE time_series (
id SERIAL UNIQUE,
name TEXT,
timestamp TIMESTAMPTZ
);
INSERT into time_series (name,timestamp) VALUES ('Test','2018-02-13T01:18:00');
INSERT into time_series (name,timestamp) VALUES ('Test','2018-02-13T01:22:00');
View C++ vs Ruby Loop
Vector<int> my_array = new Vector<int>;
my_array.add(1);
my_array.add(2);
for (int i = 0; i < my_array.length(); i++){
}
foreach(int i in my_array) {
You can’t perform that action at this time.