Skip to content

Instantly share code, notes, and snippets.

View geminorum's full-sized avatar
🏠
Working from home

Nasser Rafie geminorum

🏠
Working from home
View GitHub Profile
@geminorum
geminorum / Foo.php
Last active August 29, 2015 14:11 — forked from chrisguitarguy/Foo.php
<?php
class Foo
{
private $name;
private static $defaultInstance = null;
/**
* Public constructor: create as many instance as you want
*/
@geminorum
geminorum / parser.php
Last active August 29, 2015 14:14 — forked from martinsik/parser.php
<?php
$curl = curl_init('http://www.livescore.com/soccer/england/');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10');
$html = curl_exec($curl);
curl_close($curl);
if (!$html) {
@geminorum
geminorum / README.md
Last active August 29, 2015 14:16 — forked from hofmannsven/README.md
@geminorum
geminorum / backup.php
Last active August 29, 2015 14:16 — forked from toddsby/backup.php
<?php
/*
* PHP: Recursively Backup Files & Folders to ZIP-File
* (c) 2012-2014: Marvin Menzerath - http://menzerath.eu
* contribution: Drew Toddsby
*/
// Make sure the script can handle large folders/files
ini_set('max_execution_time', 600);
ini_set('memory_limit','1024M');
@geminorum
geminorum / jalali.erl
Last active August 29, 2015 14:23 — forked from behrad/jalali.erl
%% Copyright
-module(jalali).
-author("jrad <[email protected]>").
-define( G_DAYS_IN_MONTH, [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ] ).
-define( J_DAYS_IN_MONTH, [ 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29 ] ).
%% API
-export([
gregorian_to_jalali/1,
//Based on gulpfile.js from Google Web Starter Kit.
//https://github.com/google/web-starter-kit
'use strict';
// Include Gulp & Tools We'll Use
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var del = require('del');
var runSequence = require('run-sequence');
var browserSync = require('browser-sync');
@geminorum
geminorum / index.html
Created November 3, 2015 01:03 — forked from steren/index.html
call Wikipedia API using jQuery and parse result
<div id="insertTest"></div>
<script>
var wikipediaHTMLResult = function(data) {
var readData = $('<div>' + data.parse.text.* + '</div>');
// handle redirects
var redirect = readData.find('li:contains("REDIRECT") a').text();
if(redirect != '') {
callWikipediaAPI(redirect);
@geminorum
geminorum / csv2html.js
Created March 18, 2016 22:23 — forked from RandomEtc/csv2html.js
Quick node.js script to convert a CSV file to HTML
// first of all make sure we have enough arguments (exit if not)
if (process.argv.length != 5)
{
console.error("Usage: node csv2html.js input.csv template.ejs output.html")
console.error();
console.error("Outputs the given template for each row in the given input.")
console.error("Uses the first row of the CSV as column names in the template.")
process.exit(1);
}
@geminorum
geminorum / utf8_encode.js
Created April 21, 2016 11:16 — forked from phpmypython/utf8_encode.js
Implementation of utf8_encode in javascript
//Javascript implementation of utf8_encode function from php.
function utf8_encode(argString) {
if (argString === null || typeof argString === 'undefined') {
return '';
}
var string = (argString + ''); // .replace(/\r\n/g, "\n").replace(/\r/g, "\n");
var utftext = '',
start, end, stringl = 0;
@geminorum
geminorum / SassMeister-input-HTML.html
Created April 22, 2016 12:23 — forked from roubaobaozi/SassMeister-input-HTML.html
Generated by SassMeister.com.
<div class="someclass notip">notip</div>
<div class="someclass">not notip</div>