Skip to content

Instantly share code, notes, and snippets.

View langri-sha's full-sized avatar
😪
Three, one, four, one, z, z, z...

Filip Dupanović langri-sha

😪
Three, one, four, one, z, z, z...
View GitHub Profile
@soarez
soarez / ca.md
Last active April 22, 2024 03:01
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@jouni-kantola
jouni-kantola / stub-properties-and-methods-sinon.js
Created February 2, 2014 02:02
Sinon.JS used to stub properties and methods in a sandbox. Methods and properties are restored after test(s) are run.
define(['can', 'localCache'], function(can, localCache) {
'use strict';
describe('storeLocal()', function() {
var sandbox;
beforeEach(function() {
// create sandbox environment for mocking about
sandbox = sinon.sandbox.create();
});
@julionc
julionc / 00.howto_install_phantomjs.md
Last active April 26, 2024 09:13
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@andru255
andru255 / gist:7295850
Last active December 1, 2021 00:39
Install phantomJS and SlimerJS into linux debian 64 bits
PhantomJS (has the engine webkit)
download from the page http://phantomjs.org/download.html
and then in terminal
$ cd /usr/local/share/
$ sudo wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2
$ sudo tar jxvf phantomjs-1.9.8-linux-x86_64.tar.bz2
$ sudo ln -s /usr/local/share/phantomjs-1.9.8-linux-x86_64/ /usr/local/share/phantomjs
$ sudo ln -s /usr/local/share/phantomjs/bin/phantomjs /usr/local/bin/phantomjs
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@addyosmani
addyosmani / headless.md
Last active July 18, 2023 18:47
So, you want to run Chrome headless.

Update May 2017

Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.

Update

If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.

@cobyism
cobyism / gh-pages-deploy.md
Last active April 18, 2024 13:44
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@manpages
manpages / the-case-for-gist-blogging.org
Created April 28, 2012 06:16
Why do I love to use gist as a blog engine?

The case for Gist blogging

Why to bother?

The posts people write in blogs can be classified in two groups:

  • those that are going to be (or should be) maintained, expressing the real time information (like books one reads or read, todo lists, lecture notes, etc),
  • those that express the momentary thoughts of a writer on an event or activity.

Maintaining the post

While first ones can be managed using standart blog engines (livejournal, blogger, etc) via «Edit post» option, that’s hardly

@tychobrailleur
tychobrailleur / .jrubyrc
Created March 4, 2012 14:32
Sample .jrubyrc, with comments
# Example of .jrubyrc
# Set compilation mode. JIT = at runtime; FORCE = before execution. (JIT, FORCE, OFF, OFFIR)
# compile.mode = FORCE
# Dump to console all bytecode generated at runtime.
# compile.dump = true
# Enable verbose JIT logging (reports failed compilation)
# jit.logging.verbose = true