Skip to content

Instantly share code, notes, and snippets.

View seveibar's full-sized avatar
💭
twitter dms or mentions to get my attenion!

Severin Ibarluzea seveibar

💭
twitter dms or mentions to get my attenion!
View GitHub Profile
@seveibar
seveibar / make_fiddle.rb
Created March 1, 2014 05:41
Used on my system to create a new "fiddle" project, which is used for small web projects
#!/usr/bin/env ruby
mode = "workspace"
style = nil
markup = nil
if ARGV[0] then
mode = "nothing"
style = ARGV[0]
@seveibar
seveibar / roc.bash
Last active August 29, 2015 13:56
Used on my system to run a command on any change in a file in the current directory
#!/bin/bash
# RUN ON CHANGE
if [[ "$unamestr" == 'Linux' ]]; then
while [ 1 ]; do
clear\
&& echo "[Running \"$@\" on files changes in $(pwd) at $(date +'%r')]"\
&& echo ""\
&& echo "$@" > /home/seve/Desktop/lastroc.sh\
@seveibar
seveibar / repeat-click-recorder.rb
Last active August 29, 2015 13:56
Repeatedly clicks a location on the screen then outputs a region of the screen.
class Point
def initialize(x,y)
@x = x
@y = y
end
def x
@x
end
def y
@y
@seveibar
seveibar / repeat.bash
Created March 24, 2014 04:26
Simple script to repeat command specified number of times
#!/bin/bash
for i in $(seq 1 $1)
do
${@:2}
done
@seveibar
seveibar / feeder.bash
Last active August 29, 2015 14:02
Constantly feeds user input to given command and displays output
#!/bin/bash
# feeder script
# Constantly feeds user input to given command and displays output
fullStr=""
while true; do
read -n 1 -s nextChar
// Copyright (c) 2015, <your name>. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.
/// The SiaIExx library.
library SiaIExx;
import 'dart:async';
import 'dart:convert';
import 'package:http/http.dart' as http;
# This is the default .slate file.
# If no ~/.slate file exists this is the file that will be used.
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
alias full move screenOriginX;screenOriginY screenSizeX;screenSizeY
alias lefthalf move screenOriginX;screenOriginY screenSizeX/2;screenSizeY
alias righthalf move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY
@seveibar
seveibar / i3-rename-workspace.py
Created June 29, 2015 18:13
i3-rename-workspace
import subprocess
import json
import sys
workspaces = json.loads(subprocess.check_output("i3-msg -t get_workspaces", shell=True));
activeWorkspaceNum = None
activeWorkspaceName = None
for workspace in workspaces:
if workspace["visible"]:
activeWorkspaceNum = workspace['num']
# This script is for automatically labeling all the images in a directory with their
# names (for lab reports, technical documents etc.). Uses ImageMagick's convert command.
# Currently windows specific, but it should be easy to make compatible with linux
# This may also be possible as a one-liner with image magick.
import os
import os.path
try: os.system('rmdir labeled /s /q')
except: pass
@seveibar
seveibar / filetype_sorter.py
Created March 3, 2016 01:16
Creates directory with filetypes for all files in specified directory
import shutil
import os
from os.path import join
import time
import sys
"""
USAGE
python filetype_sorter.py <target directory>
"""
directory = sys.argv[1]