Skip to content

Instantly share code, notes, and snippets.

View jimmysitu's full-sized avatar

Jimmy Situ jimmysitu

  • ZHAOXIN, JMST
  • 1KHujLT4AzQwQKSLEUSbcergqv7fMnQNXA
View GitHub Profile
@nebil
nebil / remark.tex
Last active March 20, 2024 09:13
💬 remark -- a simple command to add inline notes in LaTeX
% This source code is licensed under a Creative Commons CC0 license.
% More info at <https://creativecommons.org/publicdomain/zero/1.0/>.
\documentclass[12pt]{article}
\usepackage{xcolor}
\begin{document}
% The main goal is to provide an easy way to write annotations in LaTeX.
% This simple snippet of code should serve as a minimal working example.
@bretton
bretton / lightning-maps.md
Last active June 4, 2024 12:36
Visualisers of the Lightning Network (and some other explorers)

A (mostly) visual collection of the Lightning Network

Disclaimer

Network views tend to be the view of the network from a single node, or small selection of nodes. They are not complete views of the network. This is impossible to achieve. Even if many node views were combined, it would still be incomplete.

These network views, or network maps, have been termed 'visualisers' by the LN community.

Screenshots may reflect older visual styles, and are dated accordingly.

#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.14.0-rc3 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
@Era-Dorta
Era-Dorta / create-efi-keys.sh
Last active July 9, 2024 14:08
Sign kernel modules on Ubuntu, useful for Nvidia drivers in UEFI system
# VERY IMPORTANT! After each kernel update or dkms rebuild the modules must be signed again with the script
# ~/.ssl/sign-all-modules.sh
# Place all files in ~/.ssl folder
mkdir ~/.ssl
cd ~/.ssl
# Generate custom keys with openssl
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -subj "/CN=Owner/"
anonymous
anonymous / morningstar.R
Created December 5, 2016 16:46
How to retrieve data from Morningstar
require(RCurl)
require(jsonlite)
myticker<-"FB"
url.histprice<-function(x){ return(paste0("http://globalquote.morningstar.com/globalcomponent/RealtimeHistoricalStockData.ashx?ticker=",x,"&showVol=true&dtype=his&f=d&curry=USD&range=1900-1-1|2014-10-10&isD=true&isS=true&hasF=true&ProdCode=DIRECT"))}
url.keyratios<-function(x){return(paste0("http://financials.morningstar.com/ajax/exportKR2CSV.html?t=",x))}
#Retrieve historical prices
json.histprice<-getURL(url.histprice(myticker))
json.histprice<-sub("NaN","\"NA\"",json.histprice)
#!/bin/sh
set -e
write_to () {
echo $2 | sudo tee $1 > /dev/null
}
set_rate () {
c=fclk$1
@Lucasus
Lucasus / Jenkins plugin dependencies tree fetcher
Last active September 8, 2021 10:18
Fetches names and versions of all dependencies of particular Jenkins Plugin. Useful for automatic plugin installations via DevOps tools like Ansible, when all required plugin dependencies have to be manually installed via Jenkins CLI
// This is app.js file
var request = require("request"),
cheerio = require("cheerio"),
_ = require("lodash");
var foundDependencies = [];
function findDependencies(error, response, body, currentDependency) {
if (error) {
console.log("We’ve encountered an error: " + error);
#!/usr/bin/env python
# coding: utf-8
import json
import sys
import re
from tornado.httputil import url_concat
from tornado.httpclient import AsyncHTTPClient
from tornado.ioloop import IOLoop
@micw
micw / install_jenkins_plugin.sh
Last active August 11, 2023 06:14
Script to install one or more jenkins plugins including dependencies while jenkins is offline
#!/bin/bash
set -e
if [ $# -eq 0 ]; then
echo "USAGE: $0 plugin1 plugin2 ..."
exit 1
fi
plugin_dir=/var/lib/jenkins/plugins
@anshula
anshula / phoronix-cmd.md
Last active March 22, 2024 21:43
Phoronix Test Suite Cheat Sheet