Skip to content

Instantly share code, notes, and snippets.

View darrylhebbes's full-sized avatar

Darryl Hebbes darrylhebbes

  • Berlin, Germany
View GitHub Profile
@darrylhebbes
darrylhebbes / gist:2265140
Last active December 13, 2017 21:26 — forked from telepenin/hack.sh
OSX For Hackers
We couldn’t find that file to show.
@darrylhebbes
darrylhebbes / sc-dl-min.js
Created November 15, 2012 16:11 — forked from duncanbeevers/sc-dl-min.js
Bookmarklet that generates download link for a Soundcloud upload
(function(a){function f(a){var b=a.find(".actionbar");return b.length?b:a.prepend('<div class="actionbar"><div class="actions"><div class="primary"></div></div></div>')}function e(a,b){var c=b.find(".actions"),d=c.find(".download");d.length||c.prepend('<a href="'+a.streamUrl+'" class="download pl-button" download="'+a.title+'" title="'+a.title+'">Download track</a>')}function d(a,b){var d=null;b.hasClass("nano")?d=f(b.closest(".track-title").find(".track")).css({marginLeft:"18px"}):b.hasClass("small")&&(d=f(b.find(".container"))),d&&c(a,d)}function c(a,b){var c=b.find(".download, .mock-download");if(!c.length){var d=$('<a class="pl-button mock-download"><span>Download</span></a>').css({backgroundImage:"url(http://soundcloud.com/images/icons_mini.png?unicorn26)",backgroundRepeat:"no-repeat",backgroundPosition:"-77px -236px",paddingLeft:"18px"}).attr("download",a.title+".mp3");b.find(".primary").append(d),d.attr("href",a.streamUrl)}}function b(a){var b=$.helpers,f=b.getPlayerTrack(b.getPlayerNode(a)),g=a.find("
@darrylhebbes
darrylhebbes / rsync-app.sh
Created April 3, 2013 21:12
A script to pass password to SSH Rsync session, without using SSH Keys. NOTE: this is not a wise solution but useful in certain situations. Usage example 1: "./rsync-app.sh B" will spawn the Rsync in the second block, "./rsync-app.sh ABC" will run all three.
#!/usr/bin/expect -f
set MachineName "Macintosh HD"
set MachineUserProfile "computerprofile"
set ProjectPath "htdocs/yourlocalprojectname"
set RemoteLogin "[email protected]"
set RemoteProjectPath "/htdocs/myproject"
set PASSPH "theSSHpassword"
class BaseCtrl
constructor: ->
console.log("All your base are belong to us!")
toJson: (item) ->
JSON.stringify(item)
class TodoCtrl extends BaseCtrl
constructor: (@$scope) ->
super
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Merge SVG paths" />
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<svg>
<path id="Line1" d="M50,50
{
"apiVersion": "0.0.3",
"swaggerVersion": "1.2",
"basePath": "http://example.com/api",
"resourcePath": "/",
"produces": ["application/json"],
"apis": [
{
"path": "/image/{filename}",
"operations": [{
@darrylhebbes
darrylhebbes / gist:11249982
Created April 24, 2014 10:43
ng-model selected item
<select name="rawProductID" name="rawProductID" ng-model="entity.rawProduct.id">
<option value="-">choose</option>
<option ng-repeat="product in products" value="{{product.id}}">{{product.name}} / {{product.id}}</option>
</select>
@darrylhebbes
darrylhebbes / cookiequirk.js
Last active August 29, 2015 14:01
AngularJS Cookie factory based on quirksmode article http://www.quirksmode.org/js/cookies.html
'use strict';
angular.module('CookieCompany', [])
.factory('Bakery', function ($document) {
return {
create : function(name, ingredients, duration) {
if (duration) {
var date = new Date();
date.setTime(date.getTime()+(duration*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
@darrylhebbes
darrylhebbes / Recruiting.md
Created July 2, 2014 14:14 — forked from ProLoser/Recruiting.md
#Post: Dear Recruiter or Hopeful Employer

Dear Recruiter or Hopeful Employer,

I'm going to be frank.

I don't have the time or energy to have a phone chat with every recruiter who contacts me. If you want to know about me, such as if I'm worth pursuing, I can answer any questions you have via email. I will only talk on the phone to employees of the prospective company.

That said, here's the answer to most questions:

  • Are you looking for a new job?
    Not really, unless it meets my specific criteria.
@darrylhebbes
darrylhebbes / t199
Created August 28, 2014 14:10
outputsvg
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="226.8" height="839.1" xml:space="preserve" text-rendering="geometricPrecision" shape-rendering="crispEdges" image-rendering="optimizeQuality"><desc>67109035 / T199</desc><defs><clipPath id="clipPath0"><rect x="24" y="66" width="180.8" height="382.7"/></clipPath><clipPath id="clipPath1"><rect x="24" y="448" width="180.8" height="384"/></clipPath></defs>
<svg id="0"><g style="clip-path: url(#clipPath0);"><g style="stroke: none; stroke-width: 1; stroke-dasharray: ; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: source-over; opacity: 0;" transform="translate(0 2.842170943040401e-14)">
<path d="M 72.297 447.9 c 0.006 0.138 0.024 0.272 0.024 0.411 v 6.742 c 0 5.668 -5.341 10.279 -11.907 10.279 c -6.564 0 -11.905 -4.6