Skip to content

Instantly share code, notes, and snippets.

View zmughal's full-sized avatar
🌿
fiddling with attribute grammars.

Zaki Mughal [sivoais] zmughal

🌿
fiddling with attribute grammars.
View GitHub Profile
@zmughal
zmughal / method.pl
Created May 2, 2021 00:48 — forked from jberger/method.pl
PDL::_data_printer
sub _data_printer {
my ($self, $props) = @_;
################################################
# Get Data, Build Structure #
# add new things as [ tag => data ] to @data #
################################################
my @data;
# type
@zmughal
zmughal / bret_victor-reading_list.md
Created July 24, 2020 07:53 — forked from nickloewen/bret_victor-reading_list.md
Bret Victor’s Reading List

This is a plain-text version of Bret Victor’s reading list. It was requested by hf on Hacker News.


Highly recommended things!

This is my five-star list. These are my favorite things in all the world.

A few of these works have had an extraordinary effect on my life or way of thinking. They get a sixth star. ★

@zmughal
zmughal / colonop.m
Last active September 12, 2015 23:25 — forked from astrojuanlu/colonop.m
MATLAB colon operator source code, obtained from http://www.mathworks.com/support/solutions/attachment.html?resid=1-4FLIOY&solution=1-4FLI96 as of 2013-11-09.
function v = colonop(a,d,b)
% COLONOP Demonstrate how the built-in a:d:b is constructed.
%
% v = colonop(a,b) constructs v = a:1:b.
% v = colonop(a,d,b) constructs v = a:d:b.
%
% v = a:d:b is not constructed using repeated addition. If the
% textual representation of d in the source code cannot be
% exactly represented in binary floating point, then repeated
% addition will appear to have accumlated roundoff error. In
#!/usr/bin/env bash
usage() { cat <<- DOCUMENT
$PROGNAME [-h] [-t] [-k key] [-l login] [server]
Utility for automatically exporting ssh keys into remote servers for authentication.
Checks $HOME/.ssh for id_rsa.pub or id_dsa.pub and appends them into
the authorized_keys of remote host
AUTHOR: Sang Han
<?php
$apiUrl = "https://www.googleapis.com/civicinfo/us_v1/representatives/lookup?fields=officials&key=AIzaSyARokMXd73Cj3k0rXRFh-s689q_uprujTY";
// $json_url = $apiUrl;
//
// $json = file_get_contents($json_url);
//
// $data = json_decode($json,true);
//
If you want to clone an svn repository with git-svn but don't want it to push all the existing branches, here's what you should do.
* Clone with git-svn using the -T parameter to define your trunk path inside the svnrepo, at the same time instructing it to clone only the trunk:
git svn clone -T trunk http://example.com/PROJECT
* If instead of cloning trunk you just want to clone a certain branch, do the same thing but change the path given to -T:
git svn clone -T branches/somefeature http://example.com/PROJECT
TodoMVC.module 'TodoApp', (App, TodoMVC, Backbone, Marionette, $, _) ->
log arguments
class App.TodoForm extends Marionette.ItemView
events:
'keypress #new-todo' : 'createOnEnter'
'click .mark-all-done' : 'toggleAllClicked'
triggers:
'click .todo-clear a' : 'clear:completed'
#!/bin/bash
#Linux Spotify Ad Mute v2
#Put this script in the directory the "spotify" binary is in (e.g. /usr/share/spotify).
#To open Spotify, run it instead of the "spotify" binary.
#System sound will be muted as soon as an ad plays
#Find updated versions at: http://pcworldsoftware.kilu.net/files/link_spotify-admute.php and/or https://gist.github.com/pcworld
#On Debian, you need the package "pulseaudio-utils" for the command line util "pactl" which used in this script
#
#Copyright (c) 2012, "pcworld", 0188801@gmail.com