Skip to content

Instantly share code, notes, and snippets.

View jcayzac's full-sized avatar

Julien Cayzac jcayzac

View GitHub Profile
[vps ~]$ curl -D - 'http://mirrorlist.centos.org/?release=6.4&arch=x86_64&repo=os'
HTTP/1.1 200 OK
Server: nginx/1.0.15
Date: Fri, 18 Apr 2014 01:35:01 GMT
Content-Type: text/plain
Connection: keep-alive
Content-Length: 0
[local ~] curl -D - 'http://mirrorlist.centos.org/?release=6.4&arch=x86_64&repo=os'
HTTP/1.1 200 OK
@jcayzac
jcayzac / result.png
Last active August 29, 2015 13:57
Transparent JPEG
result.png

#Fix the annoying OpenSSL 1.0.1 "Unknown Protocol" error with (lib)curl

  • Add a ciphers AES128-SHA,3DES line to ~/.curlrc.
  • Unfortunately, libcurl doesn't use .curlrc. So to get around the problem in git:
# some if the stuff here is macports-specific
$ port install autoconf automake
$ git clone https://github.com/git/git.git
$ cd git
@jcayzac
jcayzac / cordova-meet-cocoapods.sh
Created March 13, 2014 06:12
hooks/before_build/cordova-meet-cocoapods
#!/usr/bin/env bash
# Cordova<>Cocoapods integration hook
#############################################################
# Make this file executable (chmod +x) and install it as a #
# "before_build" hook in your Cordova application (put it #
# in the <application_root>/hooks/before_build/ directory). #
# #
# The file <application_roo>/Podfile.in with be copied to #
# platforms/ios/Podfile when the iOS platform is built, #
// Proper exceptions in JS:
function MakeErrorClass(name, parent) {
parent = parent || Error
var cls = function(message) {
parent.call(this, arguments)
if (Error.captureStackTrace)
Error.captureStackTrace(this, this.constructor)
else
this.stack = [name].concat(Error().stack.split('\n').slice(3)).join('\n')
@jcayzac
jcayzac / build
Created February 12, 2014 06:50
Overwrite platform/ios/cordova/build
#!/bin/bash
CORDOVA_PATH=$( cd "$( dirname "$0" )" && pwd -P)
PROJECT_PATH="$(dirname "$CORDOVA_PATH")"
XCODEPROJ=$( ls "$PROJECT_PATH" | grep .xcodeproj )
PROJECT_NAME=$(basename "$XCODEPROJ" .xcodeproj)
source "$CORDOVA_PATH/check_reqs"
cd "$PROJECT_PATH"
(function(d,f){f(d,'jIAAABXRUJQVlA4ICYAAACyAgCdASoCAAEALmk0mk0iIiIiIgBoSygABc6zbAAA/v56QAAAAA==')&&f(d,'h4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=')&&d.documentElement.classList.add('webp')})(document,function(d,x,i){return i=d.createElement('img'),i.src="data:image/webp;base64,UklGR"+x,i.width==2&&i.height==1})
javascript:%28function%20%28%29%20%7Bvar%20selection%20%3D%20window.getSelection%20%3F%20window.getSelection%28%29%20%3Adocument.getSelection%20%3F%20document.getSelection%28%29%20%3Adocument.selection%20%3F%20document.selection.createRange%28%29.text%20%3A%20%27%27%3Bif%20%28selection%29%20%7Bselection%20%3D%20String%28selection%29%3B%7Dif%20%28selection%29%20%7Bvar%20match%20%3D%20selection.match%28%27%5C%2F%28.%2A%29%5C%2F%27%29%3Bvar%20ipa%3Bif%20%28match%20%26%26%20match%5B1%5D%29%20%7Bipa%20%3D%20match%5B1%5D%3B%7Dif%20%28%21ipa%29%20%7Bipa%20%3D%20prompt%28%22Couldn%27t%20find%20any%20IPA.%20Type%20it%20in%20instead%3F%22%29%3B%7Dif%20%28ipa%29%20%7Bipa%20%3D%20ipa.replace%28%2F.%2Fg%2C%20function%20%28c%29%20%7Bif%20%28%2F%25u0%28...%29%2F.test%28escape%28c%29%29%29%20%7Breturn%20escape%28c%29.replace%28%2F%25u0%28...%29%2Fg%2C%20%27%26%23x%241%3B%27%29%3B%7D%20else%20%7Breturn%20c%3B%7D%7D%29%3Bvar%20request%20%3D%20%7Btxt%3A%20%27%3Cphoneme%20alphabet%3D%22ipa%22%20ph%3D%22%27%2Bipa%2B%27%22%3E%20%3
@jcayzac
jcayzac / gist:7094030
Created October 22, 2013 01:54
Export GMail inbox messages as EML files
118 messages to export:
curl -s -L -b "$GMAIL_COOKIE" 'https://mail.google.com/mail/h/?st=[0-100:100]' | grep -Eo 'th=[0-9a-f]+"' | while read LINE; do echo >&2 -n '.' ; curl -s -L -b "$GMAIL_COOKIE" "https://mail.google.com/mail/h/1khzd2wj8gtee/?&v=om&th=${LINE:3:16}" | tr -d '\r' >"$(uuidgen).eml" ; done
…then drag'n'drop to a Thunderbird folder.

Low-carb macadamia chocolate fondant

pic

Ingredients

  • 3 large egg whites
  • 15-18 macadamia nuts (35g)
  • 3 tbsp erythritol or another sweetener
  • 1 tbsp coconut oil (liquid)
  • 1 tbsp heavy cream