Skip to content

Instantly share code, notes, and snippets.

View masip85's full-sized avatar

Vicente Masip masip85

View GitHub Profile
@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
@rmondello
rmondello / gist:b933231b1fcc83a7db0b
Last active April 5, 2024 07:10
Exporting (iCloud) Keychain and Safari credentials to a CSV file

Exporting (iCloud) Keychain and Safari credentials to a CSV file

Update (October 2021)

Exporting password + one-time code data from iCloud Keychain is now officially supported in macOS Monterey and Safari 15 (for Monterey, Big Sur, and Catalina). You can access it in the Password Manager’s “gear” icon (System Preferences > Passwords on Monterey, and Safari > Passwords everywhere else), or via the File > Export > Passwords... menu item). You shouldn't need to hack up your own exporter anymore.

Original, Obsolete Content (2014)

After my dad died, I wanted to be able to have access any of his online accounts going forward. My dad was a Safari user and used iCloud Keychain to sync his credentials across his devices. I don’t want to have to keep an OS X user account around just to access his accounts, so I wanted to export his credentials to a portable file.

@mgwilliams
mgwilliams / lxc-agent-forward.sh
Last active September 30, 2020 13:50
example of how to forward ssh-agent into an lxc
#!/bin/bash
# Example Script to forward ssh-agent socket into an unprivileged lxc
# This allows access to the ssh-agent by commands executed with lxc-attach
set -m
CONTAINER=$1 # e.g., test-container
REMOTE=$2 # e.g, user@example.com
@mandiwise
mandiwise / Update remote repo
Last active May 15, 2024 09:50
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@karpathy
karpathy / gist:587454dc0146a6ae21fc
Last active May 16, 2024 19:55
An efficient, batched LSTM.
"""
This is a batched LSTM forward and backward pass
"""
import numpy as np
import code
class LSTM:
@staticmethod
def init(input_size, hidden_size, fancy_forget_bias_init = 3):
@rossant
rossant / benchmark.ipynb
Last active July 12, 2023 09:34
Quick HDF5 benchmark
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@endolith
endolith / diff of phase spectrogram.py
Last active September 9, 2020 09:54
Time derivative of phase spectrogram
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 03 2016
Show how the time derivative of phase spectrogram is constant, shows the
frequency offset within a bin
"""
from numpy import sin, linspace, pi, abs, angle, diff, unwrap
from numpy.random import randn
@internaut
internaut / pandas_crossjoin_example.py
Last active June 12, 2020 14:30
Shows how to do a cross join (i.e. cartesian product) between two pandas DataFrames using an example on calculating the distances between origin and destination cities. See https://mkonrad.net/2016/04/16/cross-join--cartesian-product-between-pandas-dataframes.html
"""
Shows how to do a cross join (i.e. cartesian product) between two pandas DataFrames using an example on
calculating the distances between origin and destination cities.
Tested with pandas 0.17.1 and 0.18 on Python 3.4 and Python 3.5
Best run this with Spyder (see https://github.com/spyder-ide/spyder)
Author: Markus Konrad <post@mkonrad.net>
April 2016
from __future__ import print_function
import numpy as np
from timeit_utils import timeit_fast
from numpy.random import rand
import matplotlib.pyplot as plt
import datetime
import socket
import sys
N_max = 100000
@claczny
claczny / fit_and_plot_normal_mixtures.R
Created September 6, 2016 11:08
Fit and plot the fitted components of a multi-modal distribution assuming normal distributions as the components.
library(ggplot2)
library(plyr)
library(mixtools)
###
# GLOBAL THEME AND GLOBAL AESTHETICS
###
old <- theme_set(theme_bw() +
theme(text = element_text(size=12),
axis.title = element_text(size = 14, face="bold"),