Skip to content

Instantly share code, notes, and snippets.

View TravelingMan's full-sized avatar
🦀
Don't panic!

S. Hall TravelingMan

🦀
Don't panic!
View GitHub Profile
@TravelingMan
TravelingMan / RiderLike.xml
Created August 24, 2017 00:26
Codinion theme similar to Jetbrains Rider 2017.1
<?xml version="1.0" encoding="utf-8"?>
<Theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ThemeColorType>Dark</ThemeColorType>
<Formats>
<Entry Key="CodinionCSharpNamespaceClassifier">
<Format IsEnabled="true">
<ClassifierName>CodinionCSharpNamespaceClassifier</ClassifierName>
<Color>#FFADD8E6</Color>
<Decorations />
</Format>
@TravelingMan
TravelingMan / new_gist_file.js
Last active January 13, 2016 01:17
Build an array with the max value of another set of arrays. Uses Math.max.apply
function getLargest(arr) {
var largestArr = [];
for (var i = 0; i < arr.length; i++) {
largestArr.push(Math.max.apply(null, arr[i]));
}
return largestArr;
}
@TravelingMan
TravelingMan / titleCase.js
Last active January 12, 2016 15:00
Simple TitleCase
function titleCase(str) {
var workArr = str.split(" ");
for (var i = 0; i < workArr.length; i++) {
workArr[i] = workArr[i][0].toUpperCase() + workArr[i].substring(1).toLowerCase();
}
return workArr.join(" ");
}
@TravelingMan
TravelingMan / jsPalindrome.js
Last active January 12, 2016 01:57
Palindrome finder
function palindrome(str) {
var palStr = str.replace(/\W/g, "").toLowerCase(); // Use /[\W_]/g to remove underscores too
for (var i = 0; i < palStr.length; i++) {
if (palStr[i] != palStr[palStr.length - 1 - i]) {
return false;
}
}
return true;
@TravelingMan
TravelingMan / jsArrayReverse.js
Last active January 11, 2016 19:59
Filtering arrays with filter(), sort, reverse
/*
Transpose the order of the elements in the array
reverse() mutates the array and returns a reference to it.
*/
var array = [1,2,3,4,5,6,7];
var newArray = [];
newArray = array.reverse();
@TravelingMan
TravelingMan / jsArrayConcat.js
Last active January 11, 2016 20:01
JS - Condense arrays with reduce, concatenate arrays
var oldArray = [1,2,3];
var newArray = [];
var concatMe = [4,5,6];
newArray = oldArray.concat(concatMe);
@TravelingMan
TravelingMan / input_events_basic.js
Created May 12, 2015 02:27
Mouse events, key event
document.addEventListener('keyup', function (event) {
var key = event.keyCode;
var letter = String.fromCharCode(key);
});
document.addEventListener('mousemove', function (event) {
console.log("mouse move x:", event.clientX, "y:", event.clientY);
});
document.addEventListener('mousedown', function (event) {
@TravelingMan
TravelingMan / function_with_array_or_delim_paramaters.js
Created May 10, 2015 20:16
From MDN. Using variable.apply() to allow the use of an array in place of standard delimited arguments without rewriting the original function.
// From MDN
function avg() {
var sum = 0;
for (var i = 0, j = arguments.length; i < j; i++) {
sum += arguments[i];
}
return sum / arguments.length;
}
@TravelingMan
TravelingMan / css_resources.md
Last active August 29, 2015 14:20 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@TravelingMan
TravelingMan / python_resources.md
Last active August 29, 2015 14:20 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides