Skip to content

Instantly share code, notes, and snippets.

View pingu1m's full-sized avatar

Felipe Gusmao pingu1m

View GitHub Profile
@osipov
osipov / gist:c2a34884a647c29765ed
Created July 21, 2014 19:12
Install Scala and SBT using apt-get on Ubuntu 14.04 or any Debian derivative using apt-get
sudo apt-get remove scala-library scala
sudo wget www.scala-lang.org/files/archive/scala-2.10.4.deb
sudo dpkg -i scala-2.10.4.deb
sudo apt-get update
sudo apt-get install scala
wget http://scalasbt.artifactoryonline.com/scalasbt/sbt-native-packages/org/scala-sbt/sbt/0.12.4/sbt.deb
sudo dpkg -i sbt.deb
sudo apt-get update
sudo apt-get install sbt
@rain1024
rain1024 / tut.md
Last active July 2, 2024 13:57
Install pdflatex ubuntu

PdfLatex is a tool that converts Latex sources into PDF. This is specifically very important for researchers, as they use it to publish their findings. It could be installed very easily using Linux terminal, though this seems an annoying task on Windows. Installation commands are given below.

  • Install the TexLive base
sudo apt-get install texlive-latex-base
  • Also install the recommended and extra fonts to avoid running into the error [1], when trying to use pdflatex on latex files with more fonts.
@adilbaig
adilbaig / git-updater
Last active June 2, 2024 13:36
A bash script to update your git repos in the background. It also pops up a user notification when a repo is synced
#!/bin/bash
# This is required for `notify-send` to work from within a cron.
# http://askubuntu.com/questions/298608/notify-send-doesnt-work-from-crontab/346580#346580
eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";
# syncAndWink
#
# Syncs all remotely-tracked branches on a git repo passed as first argument ($1). It also pulls any new branches
# and tags attached to the repo.
@Manduro
Manduro / keyboard-attach.directive.ts
Last active August 24, 2020 06:50
Ionic Keyboard Attach Directive
import { Directive, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';
import { Keyboard } from '@ionic-native/keyboard';
import { Content, Platform } from 'ionic-angular';
import { Subscription } from 'rxjs/Subscription';
/**
* @name KeyboardAttachDirective
* @source https://gist.github.com/Manduro/bc121fd39f21558df2a952b39e907754
* @description
@mivade
mivade / cli.py
Last active January 18, 2024 07:51
Using a decorator to simplify subcommand creation with argparse
"""This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@apeletz512
apeletz512 / build_hive_ddl.py
Created March 12, 2017 21:41
Generate Hive DDL string from pyspark.sql.DataFrame.schema object
def build_hive_ddl(
table_name, object_schema, location, file_format, partition_schema=None, verbose=False):
"""
:param table_name: the name of the table you want to register in the Hive metastore
:param object_schema: an instance of pyspark.sql.Dataframe.schema
:param location: the storage location for this data (and S3 or HDFS filepath)
:param file_format: a string compatible with the 'STORED AS <format>' Hive DDL syntax
:param partition_schema: an optional instance of pyspark.sql.Dataframe.schema that stores the
columns that are used for partitioning on disk
:param verbose:
@cvuorinen
cvuorinen / karma.conf.js
Last active October 19, 2020 13:03
Example configurations for running Karma & Protractor tests in headless Chrome (see http://cvuorinen.net/2017/05/running-angular-tests-in-headless-chrome/)
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
@gillescastel
gillescastel / Ultisnip snippets
Last active February 1, 2024 13:39
Vimtex setup
snippet template "Basic template" b
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[dutch]{babel}
\usepackage{amsmath, amssymb}
\begin{document}
@perfecto25
perfecto25 / default.j2
Last active July 27, 2023 19:05
Python function to send email using a Jinja HTML template
<style type="text/css">
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(http://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTa-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
.body {
width: 90%;
@skulumani
skulumani / 01-basic-vim-setup.md
Last active September 23, 2023 02:12
A minimal vimrc setup for LaTeX on mac and linux

Vim configuration

You can spend lots of time getting vim setup to your liking, and probably never finish customizing. My suggestion is to start small and stick to the basics before going crazy with plugins. While I've included some plugins, the hope is that you can easily get started with LaTeX with a minimal of effort and/or Googling.

Here is a small section of some of the things I've figured out to have vim working for editing LaTeX files easily.

  1. Copy the file below to a file vimrc and start vim vim -u vimrc to use the file. After all your customization if you are happy then save your configuration to ~/.vimrc.

  2. You can then start vim and install the plugins using the command :PlugInstall