Skip to content

Instantly share code, notes, and snippets.

@banyek
banyek / homerseklet.c
Created December 8, 2017 22:36
Reads City - Temp pairs from file, sorts, and write out
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define MAX_TEMP 100
#define NAME_LEN 128
struct city_data{
char name[128];
int temp;
#!/usr/bin/env python
from logentries import LogentriesHandler
import pymysql
import os
import logging
from ManageCluster import ManageAuroraCluster as mc
DELIMITER $$
DROP PROCEDURE IF EXISTS duplicate_rows$$
CREATE PROCEDURE duplicate_rows (IN tablename VARCHAR(255), IN times INT)
BEGIN
SET @statement = CONCAT(CONCAT(CONCAT(CONCAT("INSERT INTO ",tablename)," SELECT * FROM "),tablename),";");
PREPARE stmt FROM @statement;
WHILE times > 0 DO
SELECT times as "Remaining";
EXECUTE stmt;
SET times = times - 1;
@banyek
banyek / vimrc.vim
Last active November 4, 2020 12:20
"
" Do not forget to create ~/.vim directory
"
set nocompatible " behave VIM not VI
set number " Line numbering
autocmd BufWritePre *.pp :%s/\s\+$//e " White spaces
autocmd BufNewFile,BufRead *.pp set filetype=ruby " ruby syntax highlight for puppet
autocmd BufNewFile,BufRead *.cf set filetype=yaml " yaml syntax highlight for cloudformation
autocmd BufNewFile,BufRead *.toml set filetype=dosini " ini syntax highlith for rust's toml files