Skip to content

Instantly share code, notes, and snippets.

View anovsiradj's full-sized avatar

MDMCDC anovsiradj

View GitHub Profile
@tomysmile
tomysmile / laravel-add-createdby.md
Created January 11, 2016 07:49
Laravel: Adding Created_By
<?php

namespace App;

use Auth;
use Illuminate\Database\Eloquent\Model as Eloquent;

class BaseModel extends Eloquent{
 
@planetoftheweb
planetoftheweb / bootstrapCDN.html
Created July 8, 2015 01:25
Bootstrap 3 CDN Page Code
<!-- HEAD SECTION -->
<!-- IE Edge Meta Tag -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Viewport -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
@arturmamedov
arturmamedov / standalonepopup.html
Last active May 10, 2023 08:25
elFinder standalonepopup in a new browser window (not modal, colorbox etc.)
<!-- main.html (html input and js for open new window with elFinder for select file) -->
<input type="text" class="form-control" value="" id="idOfInput" onfocus="return openElFinder(event, 'idOfInput');"/>
<script>
$( document ).ready(function() {
window.input_id = '';
window.openElFinder = function (event, input_id) {
event.preventDefault();
window.single = true;
<?php
if(isset($_POST['source'])) {
$source = $_POST['source'];
if(isset($_POST['type']) && 'php' == $_POST['type']) {
$code = highlight_string($source, true);
$output = $code;
} else {
$code = htmlentities($source);
@danielantelo
danielantelo / microdata_resume_cv.html
Last active July 6, 2023 09:48
HTML5 Microdata Resume (Curriculum) Template
<!DOCTYPE html>
<html>
<head>
<!-- Meta conf -->
<meta charset="UTF-8">
<!-- Meta info -->
<title>HTML5 Microdata Resume (CV) Template</title>
<meta name="description" content="An example of how to layout a semantic html5 page for a curriculum vitae/resume">
<meta name="keywords" content="template, html, semantic, microdata, resume, cv, curriculum, vitae">
</head>
<?php
$db = Yii::$app->db;
$sql = $db->queryBuilder->batchInsert($table, $fields, $rows);
$db->createCommand($sql . ' ON DUPLICATE KEY UPDATE')->execute();
@hikari-no-yume
hikari-no-yume / example.php
Created March 20, 2017 20:02
function chaining for PHP 7
<?php declare(strict_types=1);
require_once "✨.🐘";
✨($_)->strlen("foo")->var_dump($_);
@philfreo
philfreo / gist:7257723
Created October 31, 2013 21:44
Facebook Perl source code from 2005. When browsing around thefacebook.com in 2005 the server spit out some server-side source code rather than running it. I believe this was for their old graph feature that let you visualize the graph between all your friends. The filename is `mygraph.svgz` and contains some gems such as a commented out "zuck" d…
#!/usr/bin/perl
use Mysql;
use strict;
use vars qw($school_name);
use vars qw($pass);
require "./cgi-lib.pl";
@shakee93
shakee93 / .htaccess
Created January 31, 2017 17:45
Laravel Apache hide .env and several security settings via .htaccess
# Disable Directory listing
Options -Indexes
# block files which needs to be hidden // in here specify .example extension of the file
<Files ~ "\.(env|json|config.js|md|gitignore|gitattributes|lock)$">
Order allow,deny
Deny from all
</Files>
# in here specify full file name sperator '|'
@mgol
mgol / jquery-es6-example.md
Last active October 12, 2023 10:34
jQuery ES6 modules example usage

jQuery source is now authored using ES6 modules. It's possible to use them directly in the browser without any build process.

To test it locally, first clone the jQuery repository:

git clone git@github.com:jquery/jquery.git

Then, write the following index.html file: