Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Bamuel's full-sized avatar
🕶️

Samuel Bamuel

🕶️
View GitHub Profile
@Bamuel
Bamuel / ssp-informix.class.php
Last active February 28, 2024 22:02
DataTables server-side processing SQL query for Informix
<?php
/*
* Helper functions for building a DataTables server-side processing SQL query
*
* The static functions in this class are just helper functions to help build
* the SQL used in the DataTables demo server-side processing scripts. These
* functions obviously do not represent all that can be done with server-side
* processing, they are intentionally simple to show how it works. More complex
* server-side processing operations will likely require a custom script.
@Bamuel
Bamuel / Jquery - ParseCSV
Last active October 25, 2023 05:24
ParseCSV Jquery with catching all types of exceptions within the csv file.
function parseCSV(strData, strDelimiter) {
// Check to see if the delimiter is defined. If not,
// then default to comma.
strDelimiter = (strDelimiter || ",");
// Create a regular expression to parse the CSV values.
var objPattern = new RegExp(
(
// Delimiters.
"(\\" + strDelimiter + "|\\r?\\n|\\r|^)" +
// Quoted fields.
@Bamuel
Bamuel / viewtable.sql
Created March 26, 2017 23:08
View tables in SQL
create view VIEW_DATA as
select * from table_name
--where CONDITION
select * from VIEW_DATA
@Bamuel
Bamuel / ReadData.cs
Last active March 17, 2017 04:06
A template for saving & reading data as .txt in C#
using System;
using System.IO;
namespace ReadData {
class Program {
static void Main(string[] args) {
ReadFile();
}
static void ReadFile() {
StreamReader reader = new StreamReader("MyData.txt");
@Bamuel
Bamuel / combinations.php
Created August 20, 2016 06:45
combinations at its finest
<?php
function limit ($n, $input) {
if ($n > 0) {
$tmp_set = array();
$res = limit($n-1, $input);
foreach ($res as $ce) {
foreach ($input as $e) {
array_push($tmp_set, $ce . $e);
}

Keybase proof

I hereby claim:

  • I am Bamuel on github.
  • I am megasamninja (https://keybase.io/megasamninja) on keybase.
  • I have a public key whose fingerprint is 78CC DD5A 03BD C7E4 AB9F 79C8 6CF6 B6A0 7258 78FE

To claim this, I am signing this object: