Skip to content

Instantly share code, notes, and snippets.

@enile8
enile8 / FizzBuzz.cc
Created January 5, 2012 03:58
FizzBuzz in C++
#include <iostream>
using namespace std;
int main(){
int i;
for (i = 0; i < 100; i++)
if (i % 3 == 0 && i % 5 == 0)
cout<<i<<" FizzBuzz\n";
else if (i % 3 == 0)
cout<<i<<" Fizz\n";
@enile8
enile8 / tempCon.cpp
Last active March 7, 2019 03:59
Simple C++ program to convert temperature from either Fahrenheit to Celsius or vise-versa.
/*******************************************************************
* C++ program to convert temperature from either Fahrenheit to *
* Celsius or vise-versa. *
* *
*******************************************************************/
#include <iostream>
#include <cctype>
using namespace std;
int main()
@enile8
enile8 / gist:2424514
Created April 19, 2012 21:59
A small example program using SQLite with C++
// A small example program using SQLite with C++
#include <iostream>
#include <sqlite3.h>
using namespace std;
static int callback(void *NotUsed, int argc, char **argv, char **azColName)
{
int i;
for(i=0; i<argc; i++)
{
@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;
}
@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 / 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 / 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 / .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 / 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 / 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'))