Skip to content

Instantly share code, notes, and snippets.

View abcsds's full-sized avatar

Alberto Barradas abcsds

View GitHub Profile
@hasherezade
hasherezade / brainfuck.l
Created May 28, 2015 18:28
BrainfuckToC (Flex & Bison)
%{
#include "brainfuck.tab.h"
#include <string.h>
#include <stdlib.h>
void error()
{
fprintf(stdout, "Plik niepoprawny pod wzglêdem leksykalnym. Linia: %d\n", yylineno);
exit(1);
}
@Ismael-VC
Ismael-VC / .juliarc.jl
Last active December 23, 2017 15:22
~/.juliarc.jl
using Compat
# using Suppressor
using OhMyREPL
const SEPARATOR = "\n\n" * "#"^80 * "\n\n"
ENV["PYTHON"] = ""
ENV["JULIA_WARN_COLOR"] = :yellow
ENV["JULIA_INFO_COLOR"] = :cyan
# ENV["LISP_PROMPT_TEXT"] = "λ ↦ "
@rishimukherjee
rishimukherjee / facepass.py
Created March 27, 2012 21:13
Example of use of SimpleCV. This creates a face recognized password.
#!/usr/bin/python
import time
from SimpleCV import Color, Image, np, Camera
cam = Camera() #initialize the camera
quality = 400
minMatch = 0.3
try:
password = Image("password.jpg")
@frantic1048
frantic1048 / nvidia-gpu-sensor.pl
Last active October 12, 2020 10:18
KDE KSysGuard NVIDIA GPU temperature/memory/utilization sensor
#!/usr/bin/perl -w
# act as a KSysGuard sensor
# provides NVIDIA GPU info via `nvidia-settings`
# Usage (e.g. add gpu temperature sensor)
# 1. save this file, make sure it has a exec permission
# 2. in KSysGuard's menu, open `File` -> `Monitor Remote Machine`
# 3.1 in new dialog, type `Host` whatever you want
# 3.2 set `Connection Type` to `Custom command`
@tomchapin
tomchapin / fish_prompt.fish
Last active December 10, 2020 11:16
My custom Fish prompt (with Git status). Based loosely on the "Terlar" theme. Place this file at ~/.config/fish/functions/fish_prompt.fish
set -xg fish_color_user d75fff
set -xg fish_color_host d78700
set -xg fish_color_git_added 00ff00
set -xg fish_color_git_clean 00ff00
set -xg fish_color_git_copied ff00ff
set -xg fish_color_git_deleted ff5f00
set -xg fish_color_git_dirty ff5f00
set -xg fish_color_git_modified 00afff
set -xg fish_color_git_renamed ff00ff
@alexmurray
alexmurray / ec
Last active January 24, 2022 16:56
Start Emacs Client in GUI (and launch Emacs server if not already running)
#!/bin/bash
# Shamelessly taken from http://mjwall.com/blog/2013/10/04/how-i-use-emacs/
# This script starts emacs daemon if it is not running, opens whatever file
# you pass in and changes the focus to emacs. Without any arguments, it just
# opens the current buffer or *scratch* if nothing else is open. The following
# example will open ~/.bashrc
# ec ~/.bashrc
@kristopherjohnson
kristopherjohnson / git-flow-cheatsheet.md
Last active October 3, 2022 11:19
git-flow Snippets
@agramfort
agramfort / pdc_dtf.py
Created March 30, 2014 16:33
Partial Directed Coherence and Direct Transfer Function using MVAR processes
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Implements Partial Directed Coherence and Direct Transfer Function
using MVAR processes.
Reference
---------
Luiz A. Baccala and Koichi Sameshima. Partial directed coherence:
a new concept in neural structure determination.
@CMCDragonkai
CMCDragonkai / job_control_zsh_bash.md
Last active January 28, 2024 00:45
CLI: Job Control in ZSH and Bash

Job Control in ZSH and Bash

All processes in ZSH/Bash under job control are in 3 states: foregrounded, backgrounded and suspended.

# run command in the foreground
command
# run commend in the background
@mxcl
mxcl / uninstall_homebrew.sh
Created August 26, 2011 11:25
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e