Skip to content

Instantly share code, notes, and snippets.

View peterujah's full-sized avatar

Chigozie Peter peterujah

View GitHub Profile
@peterujah
peterujah / gist:5a1f854b730aab1037a8096c329e775c
Created November 29, 2023 20:25 — forked from JT5D/gist:a2fdfefa80124a06f5a9
Google translate language codes
Eg. URL translating en page to es
http://translate.google.com/translate?hl=en&sl=en&tl=es&u=http://about.com
Define the web interface language to be English by adding
hl=en to the end of the URL and after the change the URL will look
like this:
http://www.google.com/search?hl=en
When you use more than one setting code in the URL, you need to use
@peterujah
peterujah / classes.bootstrap.js
Created May 12, 2019 15:29 — forked from cecilemuller/classes.bootstrap.js
Dynamically-generated (and optionally multi-steps) modals for Bootstrap 2.3.2
(function() {
"use strict";
/**
* @namespace
*/
var BOOTSTRAP = {};
/**
@peterujah
peterujah / gist:020c164e5b2c9e616eeda18015ab36cf
Created May 5, 2018 11:33 — forked from prime31/gist:5675017
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
@peterujah
peterujah / upload.php
Created March 23, 2018 15:20 — forked from gayanhewa/upload.php
PHP Script to upload files via FTP
<?php
// Ref : http://php.net/manual/en/function.ftp-put.php
$name = "test.txt";
$filename = "/home/mine/Desktop/test.txt";
//-- Code to Transfer File on Server Dt: 06-03-2008 by Aditya Bhatt --//
//-- Connection Settings
$ftp_server = "server_url_here"; // Address of FTP server.
$ftp_user_name = "username_here"; // Username
@peterujah
peterujah / Slimdown.md
Created December 7, 2016 20:55 — forked from jbroadway/Slimdown.md
Slimdown - A simple regex-based Markdown parser.

Slimdown

A very basic regex-based Markdown parser. Supports the following elements (and can be extended via Slimdown::add_rule()):

  • Headers
  • Links
  • Bold
  • Emphasis
  • Deletions
@peterujah
peterujah / foldersize.php
Created December 5, 2016 17:48 — forked from eusonlito/foldersize.php
PHP function to get the folder size including subfolders
<?php
function folderSize ($dir)
{
$size = 0;
foreach (glob(rtrim($dir, '/').'/*', GLOB_NOSORT) as $each) {
$size += is_file($each) ? filesize($each) : folderSize($each);
}