Skip to content

Instantly share code, notes, and snippets.

@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@DianaEromosele
DianaEromosele / Change "origin" of your GIT repository
Created August 7, 2016 00:31
Change "origin" of your GIT repository
$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@btoone
btoone / curl.md
Last active April 2, 2024 20:18
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@emeeks
emeeks / README.md
Last active March 25, 2024 07:56 — forked from mbostock/.block
An online tool for interactive teaching of network visualization and representation principles.

The range sliders at the top change the values for the force-directed algorithm and the buttons load new graphs and apply various techniques. This will hopefully serve as a tool for teaching network analysis and visualization principles during my Gephi courses and general Networks in the Humanities presentations.

Notice this includes a pretty straightforward way to load CSV node and edge lists as exported from Gephi.

It also includes a pathfinding algorithm built for the standard data structure of force-directed networks in D3. This requires the addition of .id attributes for the nodes, however.

Now with Clustering Coefficients!

Also, it loads images for nodes but the images are not in the gist. The code also refers to different network types but the data files on Gist only refer to the transportation network.

@mnyrop
mnyrop / which-framwork-for-which-concerns.md
Last active March 11, 2024 02:19
How I think about Omeka, CollectionBuilder, and Wax (the messy version)

How I think about Omeka, CollectionBuilder, and Wax

(the messy version)

Tl;dr

  • the more you move to spreadsheets, text editors, and the command line from applications with admin interfaces:
    • the more control you get!
    • the more work + thinking you need to put in to the workflow and how it will include your collaborators
  • sometimes this control is worth it, sometimes it isn't; it depends on your goals + resources.
  • minimal computing isn't about purity politics! it's a provocation to clarify your goals and consider alternative tools and methods to best suit the goals and resources you have.
@joewiz
joewiz / an-introduction-to-recursion-in-xquery.md
Last active January 3, 2024 15:30
An introduction to recursion in XQuery

An introduction to recursion in XQuery

  • Created: Nov 28, 2017
  • Updated: Nov 29, 2017: Now covers transformation of XML documents

Recursion is a powerful programming technique, but the idea is simple: instead of performing a single operation, a function calls itself repeatedly to whittle through a larger task. In XQuery, recursion can be used to accomplish complex tasks on data that a plain FLWOR expression (which iterates through a sequence) cannot, such as transforming an entire XML document from one format into another, like TEI or DocBook into HTML, EPUB, LaTeX, or XSL-FO. Transforming a document is well-suited to recursion because each of the document's nodes may need to be examined and manipulated based on the node's type, name, and location in the document; and once a node has been processed, the transformation must continue processing the nodes' children and descendants until the deepest leaf node has been processed. But learning the technique of recursion is often hard for a beginning program

@anderser
anderser / convert.py
Last active January 3, 2024 08:52
Convert from NodeXL (via GraphML-format) to D3-ready json for force layout while adding modularity groups (communities) as attribute to nodes. Useful for coloring nodes via modularitygroup attribute. Requires networkx and python-louvain. First export as GraphML file from your NodeXL-sheet. Then run: >>> python convert.py -i mygraph.graphml -o ou…
#!/usr/bin/env python
import sys
import argparse
import networkx as nx
import community
from networkx.readwrite import json_graph
def graphmltojson(graphfile, outfile):
@Potherca
Potherca / README.md
Last active November 27, 2023 17:44
Create a branch on Github without access to a local git repo using http://hurl.eu/

Ever had the need to create a branch in a repo on Github without wanting (or being able) to access a local repo?

With the aid of [the Github API][1] and any online request app this is a piece of cake!

Just follow these steps:

  1. Open an online request app (like apirequest.io, hurl.it pipedream.com, reqbin.com, or webhook.site)
  2. Find the revision you want to branch from. Either on Github itself or by doing a GET request from Hurl: https://api.github.com/repos/<AUTHOR>/<REPO>/git/refs/heads
  3. Copy the revision hash
  4. Do a POST request from Hurl to https://api.github.com/repos/<AUTHOR>/<REPO>/git/refs with the following as the POST body :
@ducky427
ducky427 / viz.js
Last active September 16, 2023 08:15
d3.csv("data/gates_money.csv", function(data) {
custom_bubble_chart.init(data);
custom_bubble_chart.toggle_view('all');
});
$(document).ready(function() {
$('#view_selection a').click(function() {
var view_type = $(this).attr('id');
$('#view_selection a').removeClass('active');
$(this).toggleClass('active');
@joewiz
joewiz / csv-to-xml.xq
Last active August 30, 2023 23:19
Convert CSV to XML, with XQuery
xquery version "3.1";
(: XQuery adaptation of https://github.com/digital-preservation/csv-tools/blob/master/csv-to-xml_v3.xsl.
See also the thread on basex-talk https://mailman.uni-konstanz.de/pipermail/basex-talk/2016-September/011272.html.
:)
declare function local:get-cells($row as xs:string) {
(: workaround for lack of lookahead support: append comma to end of row :)
let $string-to-analyze := $row || ","
let $analyze := fn:analyze-string($string-to-analyze, '(("[^"]*")+|[^,]*),')