Skip to content

Instantly share code, notes, and snippets.

View Jpunt's full-sized avatar

Jasper Haggenburg Jpunt

View GitHub Profile
@Jpunt
Jpunt / npm-alfred.md
Created July 12, 2018 09:12
Some handy shortcuts for npm and Alfred

npm shortcuts for Alfred

screenshot

Copy/paste these into Safari and it will add it to Alfred

Search for package

alfred://customsearch/Search%20npm%20for%20%27%7Bquery%7D%27/npm/utf8/nospace/https%3A%2F%2Fwww.npmjs.com%2Fsearch%3Fq%3D%7Bquery%7D
# When using RN in combination with Cocoapods, a lot of
# things are broken. These are the fixes we had to append
# to our Podfile when upgrading to ReactNative@0.55.3.
#
# WARNING: Check those line numbers when you're on a different version!
def change_lines_in_file(file_path, &change)
print "Fixing #{file_path}...\n"
contents = []

Keybase proof

I hereby claim:

  • I am jpunt on github.
  • I am jpunt (https://keybase.io/jpunt) on keybase.
  • I have a public key whose fingerprint is 0BB3 1062 FEB1 9586 7C99 BAA1 0233 D5E8 8124 495E

To claim this, I am signing this object:

const jsdom = require("jsdom");
jsdom.env({
html: `
<!DOCTYPE html>
<body>
<script>
var script = document.createElement("script");
script.setAttribute('type', 'application/javascript');
script.textContent = "ran = true;";
const jsdom = require("jsdom");
jsdom.env({
html: `
<!DOCTYPE html>
<body>
<script>
var script = document.createElement("script");
script.setAttribute('type', 'application/javascript');
script.textContent = "ran = true;";
@Jpunt
Jpunt / phantom-and-jasmine.spec.js
Last active August 29, 2015 14:04
Functional test with Node, Phantom and Jasmine
// npm install phantom
// npm install jasmine-node
// ./node_modules/jasmine-node/bin/jasmine-node phantom-and-jasmine.spec.js
var phantom = require('phantom');
describe("A suite", function() {
it("should open google.com", function(done) {
phantom.create(function(ph) {
ph.createPage(function(page) {
@Jpunt
Jpunt / grid-basic.css
Last active August 29, 2015 14:01
T1000 examples
@media only screen and (max-width: 399px) {
.row { padding: 8px; }
.col { padding: 8px; }
.s-1 { width: 8.33333%; }
.s-2 { width: 16.66667%; }
.s-3 { width: 25%; }
.s-4 { width: 33.33333%; }
.s-5 { width: 41.66667%; }
.s-6 { width: 50%; }
require 'rubygems'
if ENV['CODECLIMATE_REPO_TOKEN']
require 'codeclimate-test-reporter'
CodeClimate::TestReporter.start
else
require 'simplecov' unless File.exists? '.zeus.sock'
end
ENV['RAILS_ENV'] = 'test'
@Jpunt
Jpunt / console-fallback.js
Last active January 2, 2016 17:09
Fallback to use things like console.log() but not have it kill old browsers.
// This is not some kind of polyfill! It's just to prevent old browsers from failing horribly
var fallback = function() {};
var methods = ['assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 'profile', 'profileEnd', 'time', 'timeEnd', 'timeStamp', 'trace', 'warn', 'table'];
if(typeof console === 'undefined') {
var console = {};
}
for(var i in methods) {
@Jpunt
Jpunt / encode.sh
Last active January 1, 2016 20:09
A tiny bit of ZSH and Handbrake-magic to encode DVD's into mp4's
#!/usr/bin/env zsh
#
# Turns ISO-files and VIDEO_TS-directories from $encode_path into decent H264-encoded mp4's (audio/subtitle-tracks are included).
#
# Requirements:
# - ZSH
# - HandBrakeCLI
encode_path=~/Desktop/Encode
handbrake_path=/usr/bin/HandBrakeCLI