Skip to content

Instantly share code, notes, and snippets.

Merging Rubygems and Bundler

1.sh:

#!/bin/sh
set -eux
rm -rf rubygems bundler
git clone https://github.com/rubygems/rubygems
git clone https://github.com/rubygems/bundler
@lifuzu
lifuzu / add-update-github-access-token-on-mac.md
Created October 10, 2021 00:50 — forked from jonjack/add-update-refresh-github-access-token-on-mac.md
Adding & Updating GitHub Access Token on Mac

As outlined here, there are a couple of situations where you may want/need to authenticate with GitHub by using an Access Token:-

  1. If you have Two-Factor Authentication (2FA) enabled.
  2. You are accessing an organisations protected content using SAML Single-Sign On (SSO).

Using an Access Token for the first time

Create an Access Token

In your GitHub account, go to Settings / Developer settings / Personal access tokens and select Generate New Token. Make a note of the token somewhere safe since this is the only chance you get to see it.

@lifuzu
lifuzu / github-api-create-pull-request-end-to-end.py
Created September 11, 2021 05:13 — forked from nottrobin/github-api-create-pull-request-end-to-end.py
With Github API v3, create branch, commit a change to a file and open a pull request
#! /usr/bin/env python
from base64 import b64decode
from github import Github
with open('access-token.txt') as token_file:
token = token_file.read().strip()
api = Github(token)
site = api.get_repo('nottrobin/gh-cms-example-site')
@lifuzu
lifuzu / 0_reuse_code.js
Created May 15, 2017 22:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@lifuzu
lifuzu / disable mcafee endpoint protection.md
Created January 25, 2017 19:47 — forked from tegansnyder/disable mcafee endpoint protection.md
Disable McAffee Endpoint Protection OSX

method 1

sudo /usr/local/McAfee/AntiMalware/VSControl stopoas

alternatively

sudo defaults write /Library/Preferences/com.mcafee.ssm.antimalware.plist OAS_Enable -bool False
sudo /usr/local/McAfee/AntiMalware/VSControl stop
sudo /usr/local/McAfee/AntiMalware/VSControl reload
@lifuzu
lifuzu / PlistUtility.groovy
Created January 13, 2017 00:38 — forked from vgrichina/PlistUtility.groovy
Simple OS X XML property list parser
import org.codehaus.groovy.grails.plugins.codecs.Base64Codec
class PlistUtility {
static parseXmlPlistText(String text) {
def xml = new XmlParser().parseText(text)
assert xml.name() == "plist"
def parseNode
parseNode = { node ->
@lifuzu
lifuzu / reflux.js
Last active August 29, 2015 14:23 — forked from spoike/reflux.js
var EventEmitter = require('events').EventEmitter,
_ = require('lodash');
/**
* Creates an action functor object
*/
exports.createAction = function() {
var action = new EventEmitter(),
eventLabel = "action",
@lifuzu
lifuzu / index.html
Created February 18, 2015 16:48 — forked from anonymous/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>DecHex Convertor/Calculator</title>
<script type="text/javascript">
function dec2hex(dec) {
return (parseInt(dec)).toString(16);
}
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@lifuzu
lifuzu / gollum.conf
Created August 22, 2014 17:39 — forked from leon/gollum.conf
#
# Install:
# install https://github.com/github/gollum
# in /srv/wiki do a git init
# add this script to /etc/init/gollum.conf
#
# Usage:
# start/stop/restart gollum
#