This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
strip_spaces () { | |
GRUB_CMDLINE_LINUX_DEFAULT=$(echo "$GRUB_CMDLINE_LINUX_DEFAULT" | sed "s/ \+/ /g;s/^ *//g;s/ *$//g") | |
} | |
remove_parameters () { | |
for i in "$@"; do | |
GRUB_CMDLINE_LINUX_DEFAULT=$(echo "$GRUB_CMDLINE_LINUX_DEFAULT" | sed "s/$i//g") | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from gi.repository import Clutter, ClutterGst, Gdk | |
class VideoPlayer: | |
def __init__(self, filename): | |
stage_color = Clutter.Color.new(0, 0, 0, 0) | |
screen = Gdk.Screen.get_default() | |
monitor = screen.get_primary_monitor() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
# | |
# Copyright (C) 2015 Canonical Limited | |
# Author: Shih-Yuan Lee (FourDollars) <sylee@canonical.com> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Cascaded function calls in C */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct Object Object; | |
struct Object { | |
Object* (*foo)(Object*); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax on | |
set fileencodings=utf-8,big5,ucs-bom,iso8859-1 | |
set termencoding=utf-8 | |
set encoding=utf-8 | |
set shiftwidth=4 | |
set tabstop=4 | |
set expandtab | |
set nocompatible | |
set hlsearch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var num = Math.round(Math.random(new Date()) * 46) % 46; | |
if (num < 26) { | |
num = num + 65; | |
} else { | |
num = num % 26; | |
num = num + 97; | |
} | |
alert(String.fromCharCode(num)); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# generate json data from txt file | |
import re | |
def main(): | |
words = [] | |
file = open("words.txt") | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import curses | |
import time | |
import sys | |
def main(curses): | |
pad = curses.newpad(100, 100) | |
for y in range(0, 100): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" cursor highlight | |
set cursorline | |
highlight CursorLine cterm=NONE ctermbg=Black | |
autocmd InsertEnter * set nocursorline | |
autocmd InsertLeave * set cursorline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ 0.000000] Initializing cgroup subsys cpuset | |
[ 0.000000] Initializing cgroup subsys cpu | |
[ 0.000000] Linux version 2.6.24-26-generic (buildd@vernadsky) (gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3)) #1 SMP Tue Dec 1 18:37:31 UTC 2009 (Ubuntu 2.6.24-26.64-generic) | |
[ 0.000000] BIOS-provided physical RAM map: | |
[ 0.000000] BIOS-e820: 0000000000000000 - 000000000009f400 (usable) | |
[ 0.000000] BIOS-e820: 000000000009f400 - 00000000000a0000 (reserved) | |
[ 0.000000] BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved) | |
[ 0.000000] BIOS-e820: 0000000000100000 - 000000009fff0000 (usable) | |
[ 0.000000] BIOS-e820: 000000009fff0000 - 000000009fff3000 (ACPI NVS) | |
[ 0.000000] BIOS-e820: 000000009fff3000 - 00000000a0000000 (ACPI data) |