Skip to content

Instantly share code, notes, and snippets.

View Tynael's full-sized avatar
🎯
Focusing

Carol Pelu Tynael

🎯
Focusing
View GitHub Profile
javascript:void(document.oncontextmenu=null)
@Tynael
Tynael / Use Notepad within your Browser
Created June 6, 2016 10:35
Use Notepad within your Browser
data:text/HTML,%20<html%20contenteditable>
<!-- RA ADD TO CART -->
<script>
var _ra_cartBtn = document.getElementById('add');
_ra_cartBtn.addEventListener('click', function(){
if (_ra.ready !== undefined) {
_ra.addToCart({{product.id}}, 1, false, function() {
console.log("The information have been sent");
});
}
});
public class MineSweeper
{ private int[][] myTruth;
private boolean[][] myShow;
public void cellPicked(int row, int col)
{ if( inBounds(row, col) && !myShow[row][col] )
{ myShow[row][col] = true;
if( myTruth[row][col] == 0)
{ for(int r = -1; r <= 1; r++)
@Tynael
Tynael / Minesweeper - simple class
Created February 19, 2017 20:32
Minesweeper - simple class
public class MineSweeper
{ private int[][] myTruth;
private boolean[][] myShow;
public void cellPicked(int row, int col)
{ if( inBounds(row, col) && !myShow[row][col] )
{ myShow[row][col] = true;
if( myTruth[row][col] == 0)
{ for(int r = -1; r <= 1; r++)
@Tynael
Tynael / A Simple Clock
Created February 19, 2017 20:35
A Simple Clock
#include<stdio.h>
#include<time.h>
#include<windows.h>
#include <stdlib.h>
int main()
{
struct tm *tmp;
time_t s;
@Tynael
Tynael / Show Current Date
Created February 19, 2017 20:36
Show Current Date
<!DOCTYPE html>
<title>My Example</title>
<time id="date"></time>
<script>
/*
Create a JavaScript Date object for the current date and time,
then extract the desired parts, then join them again in the desired format.
@Tynael
Tynael / File Upload Script
Created February 19, 2017 20:36
File Upload Script
<html>
<head>
<title>A File Upload Script</title>
</head>
<body>
<div>
<?php
if ( isset( $_FILES['fupload'] ) ) {
print "name: ". $_FILES['fupload']['name'] ."<br />";
@Tynael
Tynael / Find your IP address
Created February 19, 2017 20:37
Find your IP address
import urllib
import re
print "we will try to open this url, in order to get IP Address"
url = "http://checkip.dyndns.org"
print url
request = urllib.urlopen(url).read()
<?php
//feedUri
$feedURL = 'http://localhost/opencart2.2.0.0/index.php?json=retargeting';
$time_start = microtime(true);
echo "<pre>";
///
$ch = curl_init($feedURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);