Skip to content

Instantly share code, notes, and snippets.

View sdmg15's full-sized avatar
👨‍💻
C++ ❤️

Sonkeng sdmg15

👨‍💻
C++ ❤️
View GitHub Profile
@technoknol
technoknol / Enable CORS in Laravel 5.4.php
Created April 26, 2017 14:10
Enable CORS in laravel 5.4
<?php
# File: app\Http\Middleware\CORS.php
# Create file with below code in above location. And at the end of the file there are other instructions also.
# Please check.
namespace App\Http\Middleware;
use Closure;
class CORS {
@sdmg15
sdmg15 / matrixComputing.java
Last active January 2, 2017 05:30
A manner to compute matrix trace, and display it with matrix data.
import java.util.Scanner;
public class sdz {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int numberOfrows ;
System.out.print("Enter the number of row and cols in the matrix : ");
@sdmg15
sdmg15 / decimal_binary.java
Created October 22, 2016 17:36
Simple decimal to binary converter
import java.util.Scanner;
public class sdz {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int nbrTodiv, modDiv,tmp;
String result ="";
System.out.println("Entrez le nombre à convertir ");
@sdmg15
sdmg15 / engine_json.html
Last active June 15, 2016 04:15
Simple search engine of towns based on DOM to parse received data.
<!doctype html>
<html>
<head>
<title>Search engine </title>
<meta charset="utf-8">
</head>
<body>
<style>
#search{
@sdmg15
sdmg15 / boot.html
Last active May 22, 2016 13:07
A simple way to upload file combining JavaScript and PHP
<!doctype html>
<html>
<head>
<title> Upload-file</title>
<meta charset="utf-8">
</head>
<body>
<form id="uploadForm" enctype="multipart/form-data" action="script.php" target="uploadFrame" method="post">
<label for="uploadFile">Image :</label>
<input id="uploadFile" name="uploadFile" type="file" />
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active September 17, 2024 17:14
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@XVilka
XVilka / TrueColour.md
Last active September 24, 2024 14:47
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active September 15, 2024 10:33
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@havvg
havvg / ajax-form.js
Created August 1, 2012 13:20
jQuery AJAX form submit with Twitter Bootstrap modal
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
@dideler
dideler / bitwise-operators.md
Created April 12, 2012 08:25
Bitwise tricks

Inspired by this article. Neat tricks for speeding up integer computations.

Note: cin.sync_with_stdio(false); disables synchronous IO and gives you a performance boost. If used, you should only use cin for reading input (don't use both cin and scanf when sync is disabled, for example) or you will get unexpected results.

Multiply by a power of 2

x = x << 1; // x = x * 2