Skip to content

Instantly share code, notes, and snippets.

@cybertk
cybertk / md_github_issue_link.py
Last active August 29, 2015 14:05
Render github issue with link
@cybertk
cybertk / git-copy
Last active August 29, 2015 14:17
Copy a remote git repo to another remote destination
#!/bin/sh
#
# Copy a remote git repo to another remote destination
# https://gist.github.com/cybertk/8a61ed9aca71a66cd711
#
# Copyright (C) 2015 Quanlong <kyan.ql.he@gmail.com>
set -e
# Options validation
@cybertk
cybertk / NSData+HexString.swift
Created August 13, 2015 17:03
Print NSData into Hex format
//
// NSData+HexString.swift
// Cybertk
//
// Created by Quanlong He on 8/14/15.
// Copyright © 2015 Quanlong He. All rights reserved.
//
import Foundation
@tuxracer
tuxracer / index.coffee
Last active December 21, 2015 16:19
yeoman generator index file in coffeescript. Compare to https://gist.github.com/tuxracer/6336244 You can also use https://github.com/tuxracer/generator-generatorcs to get this
# Generated by https://github.com/tuxracer/generator-generatorcs
path = require 'path'
yeoman = require 'yeoman-generator'
module.exports = class ChaplinGenerator extends yeoman.generators.Base
constructor: (args, options, config) ->
yeoman.generators.Base.apply this, arguments
@on 'end', ->
@installDependencies skipInstall: options['skip-install']
@kch
kch / yaml-to-plist.rb
Created August 4, 2010 14:50
Writes ruby object structures to plists. When called directly, takes a YAML file.
#!/usr/bin/env ruby
# encoding: UTF-8
require 'yaml'
require 'rexml/document'
class PlistWriter
PLIST_STUB_DOC = %q[
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"></plist>]
@czj
czj / gist:1263872
Created October 5, 2011 07:39
Script to encode with HandbrakeCLI (x264) 720p, high image quality, low file size
#!/usr/bin/env ruby
# encoding: utf-8
# x264 presets guide : https://forum.handbrake.fr/viewtopic.php?f=6&t=19426
X264 = "b-adapt=2:rc-lookahead=50:me=umh:bframes=5:ref=6:direct=auto:trellis=2:subq=10:psy-rd=1.0,0.10:analyse=all"
FORMAT = "--optimize --format mp4"
QUALITY = "--ab 64 --mixdown mono --quality 23 -e x264 -x '#{X264}'"
SIZE = "--width 1280 --height 720"
ARGV.each do |param|
@ttscoff
ttscoff / Automator Workflow.sublime-build
Last active October 22, 2018 21:38
A script to take input on STDIN and update a specified Automator (OS X) workflow action with it
{
"shell_cmd": ["cat", "$file", "|", "/usr/bin/ruby", "/Users/ttscoff/scripts/update_workflow.rb"]
}
@masonforest
masonforest / Dockerfile
Last active March 18, 2020 16:34
Test Drive Your Dockerfiles with RSpec and ServerSpec
FROM ubuntu:14.04
MAINTAINER Mason Fischer <mason@thoughtbot.com>
RUN apt-get update && apt-get install -y nodejs
@mouseroot
mouseroot / ip_routing_win7.txt
Created April 30, 2013 16:41
Enable IP Routing in Windows 7
1. Open regedit
2. Navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\"
3. Change IPEnableRouter to 1
4. Run services->Routing and Remote->start
(reboot may be nessesary)
@frdmn
frdmn / osx-10-10-virtualbox.md
Last active February 22, 2022 08:39
Install OS X 10.10 Yosemite in VirtualBox