Skip to content

Instantly share code, notes, and snippets.

Avatar
🍩
(ॢ◕ัڡ ◕ั ॢ)

Cameron Eckelberry cameck

🍩
(ॢ◕ัڡ ◕ั ॢ)
View GitHub Profile
View vscode-git-status-tree-hack.js
function injectGitFileStatus()
{
const timeout = 5000;
const addedColor = "#8dc149";
const modifiedColor = "#cbcb41";
const stagedColor = "#ca2820";
const ignoredOpacity = "0.4";
const explorer = document.getElementById("workbench.view.explorer");
if (explorer)
@cjkoepke
cjkoepke / logging_errors.js
Created Aug 10, 2017
Debugging tips and tricks.
View logging_errors.js
// Great for getting values, outputting context strings, and so on.
console.log(variable)
// Same as console.log(), but prints in yellow as a warning. Useful to show a non-breaking error in a dev env.
console.warn('It is a good idea to use .map instead of a for-loop.')
// Same as console.log(), but prints in red as an error. Useful to show a breaking error in a dev env.
console.error(`The value must be an integer. You provided a ${typeof variable}.`)
// Group console data together for better viewing. Nice to group console logs together.
@thejohnfreeman
thejohnfreeman / instructions.md
Last active Apr 19, 2021
Semantic UI fonts with Webpack in a Chrome extension
View instructions.md

To get Semantic UI fonts working:

  1. npm install semantic-ui-css

  2. Import 'semantic-ui-css/semantic.css' in your entry script. The exact syntax for this varies depending on your chosen module format: import for ES6, require for CommonJS, etc. This tells Webpack to pull the CSS into your bundle.

  3. npm install --save-dev style-loader css-loader

@andywirv
andywirv / gist:f312d561c9702522f6d4ede1fe2750bd
Created Nov 22, 2016
Update Lambda function configuration, specifically the environment variables. AWS Cli version aws-cli/1.11.20
View gist:f312d561c9702522f6d4ede1fe2750bd
#quotes on json, single around entire object and double on each property
aws lambda update-function-configuration --function-name=[lambda function name] --environment '{"Variables":{"abc":"124"}}'
@eddroid
eddroid / 1.never_boolean.md
Last active Apr 6, 2016
Ruby Refactorings
View 1.never_boolean.md

Never Boolean

You hardly ever have to use the word true in your code.

if (something == true)
  # do something cool
end

Can be rewritten as

@stinoga
stinoga / console.js
Created Dec 27, 2014
Save console output to a file
View console.js
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'