Skip to content

Instantly share code, notes, and snippets.

View iCHAIT's full-sized avatar

Chaitanya Gupta iCHAIT

View GitHub Profile
@brandonpittman
brandonpittman / dracula.fish
Created June 2, 2016 11:51
Dracula colors for fish shell
set -x COMMENT 6272a4
set -x CYAN 8be9fd
set -x GREEN 50fa7b
set -x ORANGE ffb86c
set -x PINK ff79c6
set -x PURPLE bd93f9
set -x RED ff5555
set -x YELLOW f1fa8c
set -U fish_color_autosuggestion $COMMENT
@marianposaceanu
marianposaceanu / linux_fun.md
Last active January 29, 2023 20:31
How to have some fun using the terminal.

Linux fun-o-matic

How to have some fun using the terminal.

  1. Install cowsay [0] via : sudo apt-get install cowsay
  2. Install fortune [1] via : sudo apt-get install fortune
  3. Make sure you have Ruby installed via : ruby -v
  4. Install the lolcat [2] via : gem gem install lolcat
  5. Profit!
@nuxlli
nuxlli / sublime_text_2_useful_shortcuts.md
Created September 9, 2011 18:51 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@bellbind
bellbind / ecc.py
Created December 1, 2011 08:08
[python]basics of elliptic curve cryptography
# Basics of Elliptic Curve Cryptography implementation on Python
import collections
def inv(n, q):
"""div on PN modulo a/b mod q as a * inv(b, q) mod q
>>> assert n * inv(n, q) % q == 1
"""
for i in range(q):
if (n * i) % q == 1:
@ruebenramirez
ruebenramirez / setup-franz-ubuntu.sh
Created September 7, 2016 17:55
setup franz on ubuntu
#!/bin/bash
sudo rm -fr /opt/franz
sudo rm -fr /usr/share/applications/franz.desktop
# create installation dir
sudo mkdir -p /opt/franz
#install franz
@kevinelliott
kevinelliott / osx-10.10-setup.md
Last active December 1, 2023 08:21
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@simonw
simonw / recover_source_code.md
Last active January 16, 2024 08:13
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@artero
artero / launch_sublime_from_terminal.markdown
Last active January 25, 2024 16:57 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@vitorgalvao
vitorgalvao / Get Title and URL.applescript
Last active February 15, 2024 00:57
AppleScript and JavaScript for Automation to get frontmost tab’s url and title of various browsers.
-- AppleScript --
-- This example is meant as a simple starting point to show how to get the information in the simplest available way.
-- Keep in mind that when asking for a `return` after another, only the first one will be output.
-- This method is as good as its JXA counterpart.
-- Webkit variants include "Safari", "Webkit", "Orion".
-- Specific editions are valid, including "Safari Technology Preview".
-- "Safari" Example:
tell application "Safari" to return name of front document