Skip to content

Instantly share code, notes, and snippets.

Avatar

zato uiur

View GitHub Profile
View btcd-watcher.sh
#!/bin/bash
POST_INIT_SYNC_DELAY=60
POLL_DELAY=60
STALL_THRESHOLD=5
BTCCTL='docker exec btcd btcctl --rpcuser=YOUR_USER --rpcpass=YOUR_PASS --rpccert=/rpc/rpc.cert '
stalls=0
echo "Starting watcher..."
while true; do
View google-image-similar-scraper.js
var list = require('./list.json');
var fs = require('fs');
var page = require('webpage').create();
var result = require('./result.json') || {};
var finalize = function(){
fs.write('result.json', JSON.stringify(result),'w');
phantom.exit()
}
var failSeach = function(text) {
return !(text.indexOf('画像が大きすぎるか、') === -1 &&
@nderkach
nderkach / ios_github_gif.md
Last active May 13, 2020
How to record iOS screen and share it on github
View ios_github_gif.md

Record a screencast with QuickTime Player

  1. Connect an iOS defice with a cable
  2. In QuickTime Player: Option-Cmd-N (New Movie Recording) -> Select your device from the recording menu:

http://cl.ly/image/1w0y3Y0H2g2X/record.png

Install gifify

View Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
View how to screencapture and make animated gifs or whathaveyou.md

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am

@iansinnott
iansinnott / docker_wrapper.sh
Last active Mar 20, 2016
Automatically set up boot2docker on a Mac whenever `docker` is called
View docker_wrapper.sh
#!/bin/bash
# A wrapper for the docker binary. Checks to make sure the docker host is
# set before executing docker commands.
docker() {
# Start the daemon if it's not running
if [ $(boot2docker status) != 'running' ]; then
echo 'Starting the Docker daemon.'
boot2docker start
@jbrowning
jbrowning / some_spec.coffee
Last active Apr 25, 2016
Angular & CoffeeScript: Error: [ng:areq] Argument 'fn' is not a function, got Object
View some_spec.coffee
# The $provide service is used to override an injected dependency
# Bad - results in Error: [ng:areq] Argument 'fn' is not a function, got Object
module 'someModule', ($provide) ->
$provide.value "SomeService", SomeMock
# Good
module 'someModule', ($provide) ->
$provide.value "SomeService", SomeMock
null
@dergachev
dergachev / ssh-forward-clipboard.md
Last active Jul 23, 2021
Forward your clipboard via SSH reverse tunnels
View ssh-forward-clipboard.md

Exposing your clipboard over SSH

I frequently administer remote servers over SSH, and need to copy data to my clipboard. If the text I want to copy all fits on one screen, then I simply select it with my mouse and press CMD-C, which asks relies on m y terminal emulator (xterm2) to throw it to the clipboard.

This isn't practical for larger texts, like when I want to copy the whole contents of a file.

If I had been editing large-file.txt locally, I could easily copy its contents by using the pbcopy command:

@ericboehs
ericboehs / gist:7125105
Created Oct 23, 2013
Poltergeist hack to silence CoreText performance notes from phantomjs
View gist:7125105
module Capybara::Poltergeist
class Client
private
def redirect_stdout(to)
prev = STDOUT.dup
prev.autoclose = false
$stdout = to
STDOUT.reopen(to)
prev = STDERR.dup
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active Jul 24, 2021
OS X Screencast to animated GIF
View GIF-Screencast-OSX.md

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: