Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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":
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Show off</title>
<link href="static/css/bootstrap.css" rel="stylesheet">
<link href="static/css/vertical-tabs.css" rel="stylesheet">
<style>
body {
padding-top: 70px;
@enile8
enile8 / codepenclone.html
Created July 16, 2017 16:35 — forked from pachacamac/codepenclone.html
Mini Codepen Clone with sharing function
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>MiniCodepenClone</title>
<style>
body,textarea,iframe{ margin:0; box-sizing:border-box; }
textarea,iframe { width:100%; height:50vh; float:left; }
textarea { color:#eee; background:#111; font-family:monospace; font-size:11pt; line-height:1.4; width:33.33%; }
#shareBtn { position:absolute; bottom:0; left:0; }
@enile8
enile8 / fix-wordpress-permissions.sh
Created July 11, 2017 11:51 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@enile8
enile8 / break_the_frame.js
Created May 26, 2017 11:35
break out of iframes
if(window.location != window.parent.location) {
window.parent.location = window.location;
}
@enile8
enile8 / bootstrap.flatten.css
Last active December 21, 2015 18:59 — forked from nodesocket/bootstrap.flatten.css
Added in .nav-pills
/* Flatten das boostrap */
.well, .navbar-inner, .nav-pills a, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@enile8
enile8 / db-test.php
Created June 30, 2013 06:19
A MySQL connection test script.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>MySQL Connection Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
#wrapper {
width: 600px;
margin: 20px auto 0;
@enile8
enile8 / GCD.java
Created April 20, 2013 14:30
Greatest common divisor recursion example
public class GCD {
public static void main(String[] args) {
// jacked the test values from wikipedia
// output should be 37
System.out.println(gcd(259,111));
}
public static int gcd(int x, int y) {
if (y == 0)
return x;