This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
git branch -r --merged | \ | |
awk -F/ '!/>|master/&&/origin/{print $2}' | \ | |
xargs git push origin --delete |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> j = struct('expWLS20110910', struct('temp', 1.3, 'current', 2.3)) | |
j = | |
expWLS20110910: [1x1 struct] | |
>> j.expWLS20110910.temp | |
ans = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> j = struct() | |
j = | |
1x1 struct array with no fields. | |
>> j(2).b = 4 | |
j = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ev = @(varargin) cellfun(@feval, varargin, 'UniformOutput', false); | |
% Ex.: super_anon = @(a, b, c) ev(... | |
% @() disp(a), ... | |
% @() plot(1:b, cos(1:b)), ... | |
% @() disp(c) ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Y = @(f) ... | |
feval( ... | |
@(x) f(@(v) feval(feval(x, x), v)), ... | |
@(x) f(@(v) feval(feval(x, x), v))); | |
if_ = @(pred, iftrue, iffalse) ... | |
[ arrayfun(@(~) iftrue(), zeros( pred())) ... | |
arrayfun(@(~) iffalse(), zeros(~pred())) ]; | |
then_ = @(x) x; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(window.Uber.pingData) { | |
"Name : " + window.Uber.pingData.client.firstName + " " + window.Uber.pingData.client.lastName + | |
"\nEmail : "+ window.Uber.pingData.client.email + | |
"\nPassenger Rating: "+ window.Uber.pingData.client.rating; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Prelude Data.String Data.List> (delete 'h' . delete 'h') "hi there" | |
"i tere" | |
Prelude Data.String Data.List> delete 'h' . delete 'h' $ "hi there" | |
"i tere" | |
Prelude Data.String Data.List> delete 'h' . delete 'h' ( "hi there" ) | |
<interactive>:21:14: | |
Couldn't match expected type `a0 -> [Char]' | |
with actual type `[Char]' | |
In the return type of a call of `delete' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Direction; | |
# Simple algebraic types | |
sub North { | |
die 'Invalid type' unless @_ == 1; | |
bless(sub { 'North' }, shift) | |
} | |
sub South { | |
die 'Invalid type' unless @_ == 1; | |
bless(sub { 'South' }, shift) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int func(int, int, int); | |
int | |
main() | |
{ | |
printf("%d\n", func(3, 4, 5)); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# add-dns-search-domain.sh - Tell the Docker for Mac VM to add any search domains | |
# from the host machine's resolv.conf to its own | |
# resolv.conf. Must be run every time networking is | |
# restarted on the Docker VM, or the docker VM | |
# is rebooted | |
# Find the search domains from the host's resolv.conf |
OlderNewer