Skip to content

Instantly share code, notes, and snippets.

View smockle's full-sized avatar

Clay Miller smockle

View GitHub Profile
@brandondurham
brandondurham / styles.less
Last active January 11, 2024 06:46
Using Operator Mono in Atom
/**
* Using Operator Mono in Atom
*
* 1. Open up Atom Preferences.
* 2. Click the “Open Config Folder” button.
* 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up.
* 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden!
* 5. Tweak away.
*
* Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png):

Source Code Typography

Presentation: http://www.slideshare.net/vancura/source-code-typography

Quotes

Dumb quotes (also known as straight quotes) are straight and vertical. Proper typography never uses straight quotes. They are left over from the age of typewriters, and their only modern use is for coding.

@andrewbranch
andrewbranch / sort.js
Last active September 1, 2015 01:16
Variadic sort
function getTestPeople() {
return [{
name: "Kylie",
age: 18
}, {
name: "Andrew",
age: 23
}, {
name: "Andrew",
age: 18
@andrewbranch
andrewbranch / defer-with-promise.js
Created December 19, 2014 03:20
Explore the effect of Promises on JS speed and order of execution
var trash = [];
function computationallyIntensiveStuff() {
trash.push(Math.pow(Math.pow(Math.cos(Math.sin(Math.random())), Math.random()), Math.random() * 100000));
trash.filter(function (a) { return a > Math.random(); });
}
new Promise(function (resolve, reject) {
for (var i = 0; i < 1000; i++) {
@wrenoud
wrenoud / clean_ember-cli.js
Last active May 3, 2018 08:03
Cleans uneed dependancy from Ember-CLI bower_componants folder
// based loosely on https://gist.github.com/dschmidt/a68747348036fd6aa989
// and the answer http://stackoverflow.com/questions/24782479/how-to-debug-slow-ember-cli-broccoli-builds/26044864#26044864
var glob = require('glob')
, fs = require('fs')
, util = require('util')
, _ = require('lodash');
EMBER_FILES=[
'ember/ember.js',
'ember/ember.prod.js',
# grunt-newer:
# Check for newer @import .less files example
# See: https://github.com/tschaub/grunt-newer/issues/29
newer: {
options: {
/**
* when changing a less file, we run an addional check on all the *.less files to see if they are @importing a modified *.less file, and if so we include it in the files which less task should execute.
*/
override: function(details, shouldIncludeCallback) {
@omo
omo / gist:9986103
Created April 5, 2014 01:08
HTML Imports: Discussion over Async/Progressive Loading

HTML Imports: Discussion over Async/Progressive Loading

There are concerns around HTML Imports that does sync or blocking loading as the default. I’d like to address these concerns. Especially I’d like to understand the actual use cases that “sync” loading hurts. This document aims to be a portal of that effort.

What to Block

Before discussing use cases, let’s clarify which part of page loading process HTML Imports possibly blocks. The blocking model of HTML Imports is modeled after the one for external stylesheets. There are two main bits of the blocking:

The <script> elements

@andrewbranch
andrewbranch / select2-override.css
Last active October 16, 2017 14:04
Flat styling of select2.
.select2-container .select2-choice {
height: 34px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
background-color: #fff;
background-image: none;
background: #fff;
}
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@andrewbranch
andrewbranch / ExampleView.aspx
Created September 10, 2013 16:44
HtmlHelper to generate JavaScript object from C# object
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<%= Html.WriteToJavaScript(Model, "window.model") %>
</asp:Content>