Skip to content

Instantly share code, notes, and snippets.

View cdcarson's full-sized avatar

Chris Carson cdcarson

View GitHub Profile
@pedrouid
pedrouid / webcrypto-examples.md
Created December 15, 2018 01:07
Web Cryptography API Examples
<button class="btn btn-primary" (click)="defaultModal.show()">Modal With Backdrop</button>
<ng-template nzbModal #defaultModal="nzbModal">
<!-- No attribute necessary -- same as data-backdrop="true" -->
<div class="modal fade" tabindex="-1">...</div>
</ng-template>
<button class="btn btn-primary" (click)="noBackdropModal.show()">Modal Without Backdrop</button>
<ng-template nzbModal #noBackdropModal="nzbModal">
<div class="modal fade" tabindex="-1" data-backdrop="false">...</div>
@r-brown
r-brown / howto-install-jekyll_homebrew-rbenv.txt
Last active June 12, 2022 15:23
How to install Jekyll using Homebrew and rbenv
# install Homebrew
$ su ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# show brew commands
$ brew help
# check current user
$ echo $(whoami)
# grant access to the folders
@staltz
staltz / introrx.md
Last active September 20, 2024 10:10
The introduction to Reactive Programming you've been missing
/* Non-responsive overrides for Bootstrap 3
*
* Utilize the following CSS to disable the responsive-ness of the container,
* grid system, and navbar.
*/
/* Reset the container */
.container {
max-width: none !important;
width: 970px;
@cdcarson
cdcarson / gist:5929167
Created July 4, 2013 17:12
List of Terminal shortcuts
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + L Clears the Screen, similar to the clear command
Ctrl + U Clears the line before the cursor position. If you are at the end of the line, clears the entire line.
Ctrl + H Same as backspace
Ctrl + R Let’s you search through previously used commands
Ctrl + C Kill whatever you are running
Ctrl + D Exit the current shell
Ctrl + Z Puts whatever you are running into a suspended background process. fg restores it.
Ctrl + W Delete the word before the cursor
# bash <(curl -s https://gist.github.com/drye/5387341/raw/ec72cddfe43ec3d39c91a3c118cb68ab14a049f8/enable_dnsmasq_on_osx.sh)
# ----------------------
# installing dnsmasq and enable daemon
# ----------------------
brew install dnsmasq
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons
# ----------------------
# adding resolver for vbox domain
# ----------------------
anonymous
anonymous / gist:4355043
Created December 21, 2012 19:09
How to make WordPress stop asking for FTP info when upgrading or installing plugins
define('FS_METHOD', 'direct');
@arvearve
arvearve / gist:4158578
Created November 28, 2012 02:01
Mathematics: What do grad students in math do all day?

Mathematics: What do grad students in math do all day?

by Yasha Berchenko-Kogan

A lot of math grad school is reading books and papers and trying to understand what's going on. The difficulty is that reading math is not like reading a mystery thriller, and it's not even like reading a history book or a New York Times article.

The main issue is that, by the time you get to the frontiers of math, the words to describe the concepts don't really exist yet. Communicating these ideas is a bit like trying to explain a vacuum cleaner to someone who has never seen one, except you're only allowed to use words that are four letters long or shorter.

What can you say?

@thomseddon
thomseddon / gist:3511330
Last active March 8, 2023 03:39
AngularJS byte format filter
app.filter('bytes', function() {
return function(bytes, precision) {
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-';
if (typeof precision === 'undefined') precision = 1;
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
number = Math.floor(Math.log(bytes) / Math.log(1024));
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
}
});