Skip to content

Instantly share code, notes, and snippets.

View nevrome's full-sized avatar
🛠️

Clemens Schmid nevrome

🛠️
View GitHub Profile
@msimpson
msimpson / cfire
Created July 21, 2011 10:51
Curses based ASCII art fire animation.
#!/usr/bin/python
import curses, random
screen = curses.initscr()
width = screen.getmaxyx()[1]
height = screen.getmaxyx()[0]
size = width*height
char = [" ", ".", ":", "^", "*", "x", "s", "S", "#", "$"]
b = []
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active June 21, 2024 07:34
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
@dmjio
dmjio / Stats.hs
Last active November 7, 2020 21:14
Mean, Standard Deviation, Variance in Haskell
module Main where
import Control.Applicative
{- Result = (Mean = 0.34, St. Dev = 0.115, Variance = 0.005) -}
main :: IO ()
main = interact stats
where
length' = fromIntegral . length
stats d = show (avg, stdDev, variance)
@nassimhaddad
nassimhaddad / non-ascii.R
Created January 26, 2013 18:13
remove non-ascii characters
# remove non-ascii characters
df$text <- gsub("[^\x20-\x7E]", "", df$text)
@hanshoglund
hanshoglund / pad.hs
Last active February 12, 2021 16:21
Haskell String pad
padR :: Int -> String -> String
padR n s
| length s < n = s ++ replicate (n - length s) ' '
| otherwise = s
@finalfantasia
finalfantasia / fix_gtk_warnings_issues_with_adobe_reader_32_bit_on_64_bit_linux
Created August 21, 2013 06:32
Fixes to some Gtk+ warnings/issues with 32-bit Adobe Reader 9 on 64-bit versions of Linux. These warnings will be shown when the 32-bit Acrobat Reader 9 is launched from within terminals via the 32-bit binary (acroread) on 64-bit versions of Linux. The root cause is the lack of necessary 32-bit (i386) packages on 64-bit versions of Linux. These …
WARNING: Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap":
FIX: sudo aptitude install gtk2-engines-pixbuf:i386
WARNING: Gtk-Message: Failed to load module "canberra-gtk-module"
FIX: sudo aptitude install libcanberra-gtk-module:i386
WARNING: Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita"
FIX: sudo aptitude install gnome-themes-standard:i386
@rxaviers
rxaviers / gist:7360908
Last active June 26, 2024 20:59
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@rmflight
rmflight / post-commit
Last active March 29, 2024 19:43
useful commit hooks for R package dev
#!/path/2/Rscript
# License: CC0 (just be nice and point others to where you got this)
# Author: Robert M Flight <rflight79@gmail.com>, github.com/rmflight
#
# This is a post-commit hook that after a successful commit subsequently increments the package version in DESCRIPTION
# and commits that. Analogous to the pre-commit at https://gist.github.com/rmflight/8863882, but useful if you only have
# good reasons for not doing it on the pre-commit.
#
# To install it, simply copy this into the ".git/hooks/post-commit" file of your git repo, change /path/2/Rscript, and make
@willprice
willprice / .travis.yml
Last active June 15, 2024 04:29
How to set up TravisCI for projects that push back to github
# Ruby is our language as asciidoctor is a ruby gem.
lang: ruby
before_install:
- sudo apt-get install pandoc
- gem install asciidoctor
script:
- make
after_success:
- .travis/push.sh
env:
@iangreenleaf
iangreenleaf / gist:b206d09c587e8fc6399e
Last active June 20, 2024 02:39
Rails naming conventions

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.