Skip to content

Instantly share code, notes, and snippets.

@sampointer
sampointer / gist:b506369b926ad395123aa7f18275de92
Last active July 2, 2024 01:30
NixOS Packages From Unstable alongside Stable (Google Chrome)

If you'd like to keep up-to-date with Chrome from unstable but otherwise want to run a stable NixOS release you can do the following:

  • Create a file /etc/nixos/unstable.nix:
{ config, pkgs, ...}:
let
  baseconfig = { allowUnfree = true; };
  unstable = import <nixos-unstable> { config = baseconfig; };
in {
// PhantomJS Cheatsheet
$ brew update && brew install phantomjs // install PhantomJS with brew
phantom.exit();
var page = require('webpage').create();
page.open('http://example.com', function() {});
page.evaluate(function() { return document.title; });
@paulirish
paulirish / bling.js
Last active July 23, 2024 14:51
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
};
NodeList.prototype.__proto__ = Array.prototype;
@asimpson
asimpson / emulate-cinema.js
Last active August 29, 2015 14:15
A little phantomjs script to emulate a large cinema display if you're working on a laptop or smaller screen.
var page = require ('webpage').create();
page.viewportSize = {
width: 2560,
height: 1440
};
page.open('http://seesparkbox.com', function(status) {
console.log("Status:", status);
if(status === "success") {
@lisamelton
lisamelton / transcode-video.sh
Last active May 24, 2024 17:42
Transcode video file (works best with Blu-ray or DVD rip) into MP4 (or optionally Matroska) format, with configuration and at bitrate similar to popular online downloads.
#!/bin/bash
#
# transcode-video.sh
#
# Copyright (c) 2013-2015 Don Melton
#
about() {
cat <<EOF
$program 5.13 of April 8, 2015
@sskylar
sskylar / jekyll-siteleaf.rb
Last active December 18, 2015 19:39
Jekyll to Siteleaf import script.Imports posts from Jekyll into a Siteleaf page, retains markdown and converts frontmatter into metadata/taxonomy. Requires the Siteleaf Gem (https://github.com/siteleaf/siteleaf-gem).Save to your Jekyll site folder and run in the command line using "ruby jekyll-siteleaf.rb".
require "siteleaf"
require "yaml"
# API settings
Siteleaf.api_key = '...'
Siteleaf.api_secret = '...'
# site settings
site_id = '...'
page_id = '...' # blog page to import posts into
@asimpson
asimpson / sublime_settings.json
Created January 10, 2013 02:46
sublime settings
{
"bold_folder_labels": true,
"close_windows_when_empty": true,
"color_scheme": "Packages/Theme - Aqua/Color Schemes/Tomorrow Night Aqua.tmTheme",
"detect_indentation": false,
"detect_slow_plugins": false,
"draw_centered": false,
"fade_fold_buttons": false,
"font_face": "Menlo",
"font_size": 14.0,
@cimmanon
cimmanon / flexbox.scss
Last active September 17, 2020 15:05 — forked from anonymous/Flexbox mixins
This collection of Sass mixins to cover all 3 flexbox specifications that have been implemented. More information can be found here: https://gist.github.com/cimmanon/727c9d558b374d27c5b6
@import "compass/css3/shared";
// NOTE:
// All mixins for the 2009 spec have been written assuming they'll be fed property values that
// correspond to the standard spec. Some mixins can be fed values from the 2009 spec, but don't
// rely on it. The `legacy-order` mixin will increment the value fed to it because the 2009
// `box-ordinal-group` property begins indexing at 1, while the modern `order` property begins
// indexing at 0.
// if `true`, the 2009 properties will be emitted as part of the normal mixin call
@ttscoff
ttscoff / grablinks.js
Created September 30, 2012 19:42
Bookmarklet to send all links within clicked div/table to Pinboard
@ttscoff
ttscoff / matrixish.sh
Created September 15, 2012 18:23
A Matrix-ish display for Bash terminal
#!/bin/bash
#
# matrix: matrix-ish display for Bash terminal
# Author: Brett Terpstra 2012 <http://brettterpstra.com>
# Contributors: Lauri Ranta and Carl <http://blog.carlsensei.com/>
#
# A morning project. Could have been better, but I'm learning when to stop.
### Customization:
blue="\033[0;34m"