Skip to content

Instantly share code, notes, and snippets.

View czmole's full-sized avatar
🚀
Working on a dream

Catalin Zmole czmole

🚀
Working on a dream
View GitHub Profile
@czmole
czmole / timeline.css
Created August 29, 2016 22:12 — forked from LibertysYarn/timeline.css
Responsive Timeline - Bootstrap 3
.timeline {
list-style: none;
padding: 20px 0 20px;
position: relative;
}
.timeline:before {
top: 0;
bottom: 0;
position: absolute;
@czmole
czmole / index.html
Created September 5, 2016 14:43 — forked from fcingolani/index.html
How to render a full PDF using Mozilla's pdf.js
<html>
<body>
<!-- really dirty! this is just a test drive ;) -->
<script type="text/javascript" src="https://raw.github.com/mozilla/pdf.js/gh-pages/build/pdf.js"></script>
<script type="text/javascript">
function renderPDF(url, canvasContainer, options) {
var options = options || { scale: 1 };
@czmole
czmole / PushNotifications.php
Created January 7, 2017 08:37 — forked from joashp/PushNotifications.php
Simple PHP script to send Android Push Notification, iOS Push Notification and Windows Phone 8 Push Notification
<?php
// Server file
class PushNotifications {
// (Android)API access key from Google API's Console.
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI';
// (iOS) Private key's passphrase.
private static $passphrase = 'joashp';
// (Windows Phone 8) The name of our push channel.
private static $channelName = "joashp";
@czmole
czmole / gist:d9809b833418bfc33614ad6cac9a481e
Created January 28, 2017 23:08 — 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
@czmole
czmole / BaseModel.php
Created March 16, 2017 13:50 — forked from erdhee/BaseModel.php
Dynamic Accessors Laravel
<?php
class BaseModel extends Eloquent
{
public function addAttributes($query, $attributes = array())
{
// $query should be an eloquent collection
return $query->each(function($q) use($attributes){
$q->setAppends($attributes);
@czmole
czmole / .env.example
Created May 24, 2017 05:57 — forked from iolson/.env.example
GitLab CI Laravel 5.1.*
DB_HOST=mysql
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
@czmole
czmole / curl.md
Created September 7, 2017 09:42 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@czmole
czmole / gist:49f3eb79c1aaf99352de67b7a4fcd5d9
Created September 19, 2017 11:06 — forked from mintindeed/gist:4600385
Bash script for git pull using username and password
#!/bin/bash
path="/var/www/sites/htdocs/wp-content/themes/vip/";
git_path="https://username:password@bitbucket.org/penskemediacorp/";
git_array=( plugins pmc-variety pmc-plugins );
git_path_array=("${git_array[@]}")
@czmole
czmole / jquery-scroll-bottom.js
Created October 13, 2017 08:34 — forked from toshimaru/jquery-scroll-bottom.js
Detect the scrolling to bottom of the page using jQuery.
$(window).on("scroll", function() {
var scrollHeight = $(document).height();
var scrollPosition = $(window).height() + $(window).scrollTop();
if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
// when scroll to bottom of the page
}
});
@czmole
czmole / build.sh
Created October 30, 2017 08:24
Script for building Ubuntu 16.04 server + LAMP + Redis, Memcached, Lets Encrypt, Git, Composer + Optimisations
## Builder for Ubuntu 16.04 ##
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get autoclean
sudo apt-get --purge autoremove
# Install dependancies
sudo apt-get install curl git unzip