Skip to content

Instantly share code, notes, and snippets.

View trisweb's full-sized avatar
🕶️

Tristan Harward trisweb

🕶️
View GitHub Profile
@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@trisweb
trisweb / survey.html
Created July 9, 2014 20:09
Angular Survey using Firebase
<!DOCTYPE html>
<html ng-app="MyApp">
<!-- Made by Tristan Harward. BSD Licensed (because Berkeley > MIT) -->
<!--
Copyright (c) 2014, Tristan S. Harward
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@chrisb
chrisb / gist:4d6a09c6cc1ca2e1b14e
Last active November 25, 2022 04:15
Homebrew, Ruby, and Rails on OS X 10.10

OS X 10.10 Guide

Here's what I did to get things working.

1. Install Xcode 6

Yep, over at: https://developer.apple.com

2. Install the Command Line Tools (CLT)

@bomberstudios
bomberstudios / sketch-plugins.md
Last active February 26, 2024 07:02
A list of Sketch plugins hosted at GitHub, in no particular order.
@nbibler
nbibler / gist:5307941
Last active October 7, 2021 09:38
A .powrc file which works with RVM's .rvmrc or .ruby-version (+ .ruby-gemset) configuration files.
if [ -f "$rvm_path/scripts/rvm" ]; then
source "$rvm_path/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
fi
if [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
fi
@ryanbriones
ryanbriones / gist:3243872
Created August 3, 2012 02:54
Plain HTML "templates", with ERB layout, from Sinatra
class MySinatraApplication < Sinatra::Base
get "/some-mockup-path" do
html :somemockup
end
helpers do
def html(template, options = {}, locals = {})
render :html, template, options, locals
end
@harley
harley / gist:3118186
Created July 15, 2012 19:07
remove old branches that have been merged
# adapted from http://devblog.springest.com/a-script-to-remove-old-git-branches
# This has to be run from master
git checkout master
# Update our list of remotes
git fetch
git remote prune origin
# Remove local fully merged branches
@trisweb
trisweb / postgresql.rb
Created June 4, 2012 17:58
Homebrew PostgreSQL 9.2 Beta 2 Formula
require 'formula'
class Postgresql < Formula
homepage 'http://www.postgresql.org/'
url 'http://ftp.postgresql.org/pub/source/v9.2.0beta2/postgresql-9.2beta2.tar.bz2'
md5 'f23eca70a6de56de73f0005a571c71b0'
depends_on 'readline'
depends_on 'libxml2' if MacOS.leopard? # Leopard libxml is too old
depends_on 'ossp-uuid'
@trisweb
trisweb / ffmpeg-avchd-conversion.md
Created March 5, 2012 18:13
ffmpeg commands for converting AVCHD-Lite video to better format(s)

FFMpeg Commands for Transcoding MTS video (from AVCHD-Lite Cameras, like Panasonic DMC-TS1/2)

720p -> H.264 (x264) video + AAC 128kbps audio:

Medium quality 720p:

ffmpeg -i 00001.MTS -threads 3 -y -vcodec libx264 -sameq -acodec libfaac -ab 128k -ar 44100 -ac 2 -s 1280x720 -vpre normal -b 1M output.mp4

High quality 720p:

@psebborn
psebborn / countCSSRules.js
Last active April 25, 2023 11:43
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {