Skip to content

Instantly share code, notes, and snippets.

@enile8
enile8 / classClass.cpp
Created February 5, 2013 02:35
A (crude) C++ example of using a class within a class.
#include <iostream>
#include <string>
using namespace std;
class alpha
{
public:
static string alphaFunc()
{
return "Greetings from the alpha class.\n";
@enile8
enile8 / localtime.c
Created January 8, 2013 03:26
Display the current local time using C.
#include <stdio.h>
#include <time.h>
int main ()
{
time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );
@enile8
enile8 / writing.c
Created January 8, 2013 03:23
Writing to file with C
#include <stdio.h>
int main()
{
char str [256];
puts("Enter some text you would like to add to the file:");
fgets(str,255,stdin);
FILE * pFile;
pFile = fopen("myfile.txt", "a");
if (pFile==NULL)
@enile8
enile8 / lcm.py
Last active December 10, 2015 19:19
Finding the lowest common multiple with python
def gcd(arg1, arg2):
while arg2 > 0: arg1,arg2 = arg2, arg1 % arg2
return arg1
def contest1(arg1, arg2):
result = arg1 * arg2 / gcd(arg1,arg2)
return result
num1 = int(raw_input('Enter the first number:\n'))
num2 = int(raw_input('Enter the second number:\n'))
@enile8
enile8 / style.css
Created January 8, 2013 03:14
Twenty Ten Horizontal Subnav CSS.
/*
Theme Name: Twenty Ten Horizontal Subnav
Theme URI: http://enile8.org/blog/adding-horizontal-subnav-to-the-twenty-ten-theme
Description: The 2010 theme for WordPress is stylish, customizable, simple, and readable -- make it yours with a custom menu, header image, and background. Twenty Ten supports six widgetized areas (two in the sidebar, four in the footer) and featured images (thumbnails for gallery posts and custom header images for posts and pages). It includes stylesheets for print and the admin Visual Editor, special styles for posts in the "Asides" and "Gallery" categories, and has an optional one-column page template that removes the sidebar.
Author: the WordPress team, modified by enile8
Author URI: http://enile8.org
Version: 0.1
Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style
Template: twentyten
*/
@enile8
enile8 / .vimrc
Created September 20, 2012 18:37
My vimrc
set noswapfile
" ================ auto reload vimrc when editing it ================
autocmd! bufwritepost .vimrc source ~/.vimrc
" ================ define your colors for todo task note in code ================
if !exists("autocmd_colorscheme_loaded")
let autocmd_colorscheme_loaded = 1
autocmd ColorScheme * highlight TodoRed ctermbg=darkgreen guibg=#002b37 ctermfg=LightRed guifg=#E01B1B
autocmd ColorScheme * highlight TodoOrange ctermbg=darkgreen guibg=#002b37 ctermfg=LightMagenta guifg=#E0841B
@enile8
enile8 / primenum.c
Created July 28, 2012 02:20
Is it a Prime Number?
#include <stdio.h>
int main(void) {
int n,
lcv,
flag; /* flag starts as 1 and becomes 0 if it's determined that the
number is not prime */
printf("Enter value of the number\n");
scanf("%d", &n);
@enile8
enile8 / tempCon.py
Last active September 16, 2018 17:31
Python temp conversion
####################################################################
#Python program to convert temperature from either Fahrenheit to #
#Celsius or vise-versa. This is a very simple function example. #
# #
####################################################################
def convert(temp, unit):
unit = unit.lower()
if unit == "c":
@enile8
enile8 / style.css
Created July 23, 2012 19:51
Horizontal Subnav On The Twenty Eleven Theme
/*
Theme Name: Twenty Eleven Child
Description: Twenty Eleven Child Theme with Horizontal Subnav.
Author: Blake <-- That's me!
Template: twentyeleven
*/
@import url("../twentyeleven/style.css");
/* =Menu
@enile8
enile8 / news.css
Created April 21, 2012 23:58
My Hacker News Style
body {
margin: 0;
background-image: url(http://subtlepatterns.com/patterns/furley_bg.png);
}
body > center > table {
width: 100%;
background-color: transparent;
}