Skip to content

Instantly share code, notes, and snippets.

@nivir
nivir / compress_pdf.sh
Created April 2, 2023 20:13 — forked from metacritical/compress_pdf.sh
Compress/optimize PDF file
#! /bin/bash
# AUTHOR: (c) Ricardo Ferreira
# NAME: Compress PDF 1.4
# DESCRIPTION: A nice Nautilus script with a GUI to compress and optimize PDF files
# REQUIRES: ghostscript, poppler-utils, zenity
# LICENSE: GNU GPL v3 (http://www.gnu.org/licenses/gpl.html)
# WEBSITE: https://launchpad.net/compress-pdf
# Messages
@nivir
nivir / .gitaliases
Created February 20, 2023 00:24 — forked from dgrebb/.gitaliases
Aliases for use with Git.
#
# Aliases
# (sorted alphabetically)
#
alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gapa='git add --patch'
@nivir
nivir / aliases
Created February 20, 2023 00:21 — forked from quent01/aliases
CMDER aliases configuration
;= @echo off
;= rem Call DOSKEY and use this file as the macrofile
;= %SystemRoot%\system32\doskey /listsize=1000 /macrofile=%0%
;= rem In batch mode, jump to the end of the file
;= goto:eof
;= Add aliases below here
;= -----------------------------------------------------
;=
;= $$$$$$\ $$\ $$\ $$$$$$$\ $$$$$$$$\ $$$$$$$\
;= $$ __$$\ $$$\ $$$ |$$ __$$\ $$ _____|$$ __$$\
@nivir
nivir / memory.js
Created November 25, 2013 07:13
Color Memory Game written in Java Script
var buttons = new Array()
var allButtons = new Array()
var flipButton = new Array()
var colours
var coordinates = {x:1, y:1}
var gameScore=0
var removedCount = 0
function changeCoords(x,y) {
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#https://spacy.io/usage/spacy-101
import spacy
nlp = spacy.load("en_core_web_sm")
doc = nlp(unicode("Apple is looking at buying U.K. startup for $1 billion"))
def fun_annotations():
@nivir
nivir / sentiment_classifier.py
Created April 21, 2021 19:05 — forked from muddana/sentiment_classifier.py
sentiment analysis of twitter data.
# down the test/train data : http://www.stanford.edu/~alecmgo/cs224n/twitterdata.2009.05.25.c.zip
#into a folder "corpus" at the level of this file (else u need to change inside the code for now)
import nltk
import random
import re
import gc
from pymongo import Connection
#method defs
@nivir
nivir / git-clearHistory
Created January 10, 2021 04:30 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@nivir
nivir / bashpath.sh
Created January 1, 2021 20:50 — forked from darrenderidder/bashpath.sh
Get path of running script in bash
#!/bin/bash
# A simple test script to demonstrate how to find the
# "absolute path" at which a script is running. Used
# to avoid some of the pitfals of using 'pwd' or hard-
# coded paths when running scripts from cron or another
# directory.
#
# Try it out:
# run the script from the current directory, then
@nivir
nivir / Twilight-Fichte.YAML-tmTheme
Created December 24, 2020 01:37 — forked from FichteFoll/Twilight-Fichte.YAML-tmTheme
My color scheme for Sublime Text, a modified version of Twilight
# [PackageDev] target_format: plist, ext: tmTheme
author: Michael Sheets, modified by FichteFoll
name: Twilight-Fichte
uuid: 766026CB-703D-4610-B070-8DE07D967C5F
settings:
- settings:
background: '#141414'
caret: '#A7A7A7'
foreground: '#F8F8F8'