Skip to content

Instantly share code, notes, and snippets.

View d30jeff's full-sized avatar
💭
Eating caviar and hacking famine

Deojeff d30jeff

💭
Eating caviar and hacking famine
View GitHub Profile
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script type="text/javascript" src="dojoroot/dojo/dojo.js"
djConfig="parseOnLoad: true, isDebug: false">
</script>
<script type="text/javascript">
function readFile() { //
@d30jeff
d30jeff / default
Created July 25, 2015 05:24
Config
# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts to this file
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
@d30jeff
d30jeff / index.php
Created July 25, 2015 00:48
9/11 was an inside job.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script>
function editAction(id){
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Manage Admins - NCBA &amp; E</title>
<?php include('head.php');?>
</head>
<body class="skin-blue sidebar-mini">
<div class="wrapper">
<?php include ('header.php');?>
#include <stdio.h>
#include <string.h>
char* getConfig(int lineNumber)
{
// const char fileName[150] = filePath;
FILE *file;
file = fopen("config.txt", "r");
int count = 0;
@d30jeff
d30jeff / readFile.c
Created July 21, 2015 03:56
Read .txt file in C
int read_config(char filePath, int lineNumber, char *lineValue)
{
const char fileName[150] = filePath;
FILE *file;
file = fopen(fileName, "r");
int count = 0;
if (file != NULL)
{
char singleLine[200];
@d30jeff
d30jeff / alembic.py
Created July 20, 2015 07:52
Alembic add non-null column
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.add_column('location', sa.Column('key', sa.String(length=36)))
op.execute("UPDATE location SET key='NA'")
op.execute("ALTER TABLE location ALTER COLUMN key SET NOT NULL")
### end Alembic commands ###
#include <stdio.h>
#include <time.h>
int main()
{
time_t mytime;
mytime = time(NULL);
printf(ctime(&mytime));
return 0;
@d30jeff
d30jeff / myfile.py
Created June 28, 2015 01:39
Stackoverflow request help
# Function files:
def convert_to_csv(json_format):
"""Converts json to csv."""
csv_data = ""
if json_format:
for x in json_format:
csv_data += str(x['name']) + "," + str(x['flowrate']) + "," + str(x['temperature']) + "," + str(x['power']) + "," +str(x['log_time']) + "," + str(x['created_on']) + "\n"
return csv_data
csv_data = ""
for x in json_format:
csv_data += str(x['name']) + str(x['flowrate']) + str(x['temperature']) + str(x['power']) + str(x['log_time']) + str(x['created_on'])