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
/* | |
A small part of 200 lines long function from Git source code. | |
*/ | |
if (inaccurate_eof && | |
old > oldlines && old[-1] == '\n' && | |
newlines.len > 0 && newlines.buf[newlines.len - 1] == '\n') { | |
old--; | |
strbuf_setlen(&newlines, newlines.len - 1); | |
preimage.line_allocated[preimage.nr - 1].len--; | |
postimage.line_allocated[postimage.nr - 1].len--; |
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
private final String host = "ssprojectinstance.csv2nbvvgbcb.us-east-2.rds.amazonaws.com" | |
private final String database = "postgres"; | |
private final int port = 5432; | |
private final String user = "postgres"; | |
private final String pass = "123456"; |
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
private final String host = "35.44.16.169"; | |
private final String database = "postgres"; | |
private final int port = 5432; | |
private final String user = "postgres"; | |
private final String pass = "123456"; |
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
private final String host = "10.0.2.2"; | |
private final String database = "postgres"; | |
private final int port = 5432; | |
private final String user = "postgres"; | |
private final String pass = "123456"; |
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
{% for k,v in story_content.items %} | |
{{ k }} # request.POST dictionary key | |
{{ v | safe }} | |
{% endfor %} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
{% load static %} | |
<script src="{% static 'tinymce/tinymce.min.js' %}" referrerpolicy="origin"></script> | |
<style> | |
.demo-dfree { | |
position: relative; | |
width: 690px; | |
box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.2); |
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
<form class='demo-dfree' method="post"> | |
{% csrf_token %} | |
<header> | |
<h1 class="dfree-header mce-content-body" contenteditable="true" style="position: relative;" spellcheck="false"> | |
{{ story.title }} | |
</h1> | |
<br/> | |
<p class="dfree-description mce-content-body" contenteditable="true" style="position: relative;" spellcheck="false"> | |
{{ story.description }} |
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
def edit_story(request, story_id): | |
if request.method == "POST": | |
title = request.POST["mce_0"] | |
description = request.POST["mce_2"] | |
content = request.POST["mce_3"] | |
update_story_object(story_id, title, description, content) | |
return redirect("show_story_page", story_id) |
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
#include <time.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <assert.h> | |
// gcc mocking.c -Wl,--wrap=rand -o mocking.exe | |
int __wrap_rand() | |
{ | |
return 5; |
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
#include <stdio.h> | |
#include <stdarg.h> | |
int process(int param, va_list var_args) | |
{ | |
printf("\nThe First Param : %d", param); | |
char* name = va_arg(var_args, char*); | |
if(NULL != name) | |
printf(" \nThe String Param I Expect : %s", name); |
NewerOlder