Skip to content

Instantly share code, notes, and snippets.

View cvcore's full-sized avatar
🍀
🎼🎏

Cheng cvcore

🍀
🎼🎏
View GitHub Profile
@jamesmacfie
jamesmacfie / README.md
Created October 22, 2019 02:53
iTerm 2 - script to change theme depending on Mac OS dark mode

How to use

In iTerm2, in the menu bar go to Scripts > Manage > New Python Script

Select Basic. Select Long-Running Daemon

Give the script a decent name (I chose auto_dark_mode.py)

Save and open the script in your editor of choice.

@botforge
botforge / gym_to_gif.py
Last active December 4, 2023 07:22
Save OpenAI Gym renders as GIFS
from matplotlib import animation
import matplotlib.pyplot as plt
import gym
"""
Ensure you have imagemagick installed with
sudo apt-get install imagemagick
Open file in CLI with:
xgd-open <filelname>
@zulhfreelancer
zulhfreelancer / install-docker.md
Last active April 25, 2024 02:35
Install Docker oneliner script

Just install Docker

$ curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh

Install Docker and Rancher Server

$ curl -fsSL get.docker.com -o get-docker.sh &amp;&amp; sh get-docker.sh &amp;&amp; sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server

@NoMan2000
NoMan2000 / openssl.md
Last active March 14, 2024 17:31 — forked from zhiguangwang/openssl.md
Common OpenSSL Commands with Keys and Certificates

Common OpenSSL Commands with Keys and Certificates

SSL Info

Generate RSA private key with certificate in a single command

openssl req -x509 -newkey rsa:4096 -sha256 -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650 -passout pass:foobar

Generate Certificate Signing Request (CSR) from private key with passphrase

openssl x509 -x509toreq -in example.crt -out example.csr -signkey example.key -passin pass:foobar

@PurpleBooth
PurpleBooth / README-Template.md
Last active April 26, 2024 01:29
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@poltorrr
poltorrr / vt_resize.php
Last active August 29, 2015 14:18 — forked from seedprod/vt_resize.php
Image resize
<?php
/*
* Resize images dynamically using wp built in functions
* Victor Teixeira
*
* php 5.2+
*
* Exemplo de uso:
*
* <?php
@ljlin
ljlin / JavaScript for OS X Automation
Created March 17, 2015 14:38
JavaScript for OS X Automation, NSTask, jar
ObjC.import("Cocoa");
var MarsPath = "/Applications/Mars4_5.jar"
var arg = $.NSArray.arrayWithObjects(MarsPath)
var task = $.NSTask.alloc.init
task.setLaunchPath("/usr/bin/open")
task.setArguments(arg)
task.launch
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active April 25, 2024 23:33
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@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
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 25, 2024 06:23
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname