Skip to content

Instantly share code, notes, and snippets.

@hofmannsven
hofmannsven / README.md
Last active October 2, 2025 20:17
Git CLI Cheatsheet
@soomtong
soomtong / summernote.php
Last active March 2, 2022 12:14
(deprecated) summernote example with php
<!-- this version of sample is too old. it's not follow recent version of summernote api -->
<!-- should check new apis and examples! sorry I am. -->
<!DOCTYPE html>
<html lang="en">
<!-- include libries(jQuery, bootstrap, fontawesome) -->
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.no-icons.min.css" rel="stylesheet">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet">
@jimbohne
jimbohne / followers.php
Last active June 5, 2024 21:27 — forked from bcantoni/friends.php
Use Twitter API to export data (in CSV format) on people that are following you. See Installation notes for steps. Prerequisites: 1) Twitter OAuth PHP library 2) Create your own Twitter application and OAuth keys/tokens.
<?php
/* followers.php - use Twitter API to export data (CSV format) on people that are following you
Installation:
1. Install Twitter OAuth PHP library (https://github.com/abraham/twitteroauth)
2. Adjust twitteroauth.php include path below
3. Create Twitter application (https://dev.twitter.com/apps)
4. Fill in 4 Twitter app keys below
5. Adjust $fields array if you want different fields saved
@eimg
eimg / pdo-wrapper.php
Last active November 29, 2022 11:20
Simple yet secure PHP PDO database wrapper with CRUD methods...
<?php
# PDO Wrapper, supporting MySQL and Sqlite
# Usage:
# $db = new db();
#
# // table, data
# $db->create('users', array(
# 'fname' => 'john',
# 'lname' => 'doe'
# ));
@ksafranski
ksafranski / SimpleStore.js
Last active July 2, 2022 15:25
Simple localStorage function with Cookie fallback for older browsers.
/**
* Simple localStorage with Cookie Fallback
* v.1.0.0
*
* USAGE:
* ----------------------------------------
* Set New / Modify:
* store('my_key', 'some_value');
*
* Retrieve:
@ideefixe
ideefixe / form_validation.js
Created January 25, 2013 20:50
Javascript Form Validation
function init() {
$('#general').on('submit', function(e) {
pass = true;
$('input, textarea', this).removeClass('error');
$('input, textarea', this).each(function() {
if ($(this).val() === '') {
$(this).addClass('error');
pass = false;
}
@corsonr
corsonr / jquery.ui.datepicker-fr.js
Created December 16, 2012 10:53
jQuery UI datepicker in French
/* French initialisation for the jQuery UI date picker plugin. */
/* Written by Keith Wood (kbwood{at}iinet.com.au) and Stéphane Nahmani (sholby@sholby.net). */
jQuery(function($){
$.datepicker.regional['fr'] = {
closeText: 'Fermer',
prevText: '&#x3c;Préc',
nextText: 'Suiv&#x3e;',
currentText: 'Aujourd\'hui',
monthNames: ['Janvier','Fevrier','Mars','Avril','Mai','Juin',
'Juillet','Aout','Septembre','Octobre','Novembre','Decembre'],
@menzerath
menzerath / backup.php
Last active February 18, 2024 19:33
PHP: Recursively Backup Files & Folders to ZIP-File
<?php
/*
* PHP: Recursively Backup Files & Folders to ZIP-File
* MIT-License - 2012-2018 Marvin Menzerath
*/
// Make sure the script can handle large folders/files
ini_set('max_execution_time', 600);
ini_set('memory_limit', '1024M');
@fjaguero
fjaguero / opengraph-wordpress.php
Created October 17, 2012 08:32
Add Facebook Open Graph Meta Data to Wordpress
//Adding the Open Graph in the Language Attributes - functions.php
function add_opengraph_doctype( $output ) {
return $output . ' xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"';
}
add_filter('language_attributes', 'add_opengraph_doctype');
//Lets add Open Graph Meta Info
function insert_fb_in_head() {
<?php
curl_setopt($ch, CURLOPT_URL, '<IDRIVESYNC SERVER LOCATION>/evs/downloadEvent');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
$body = 'uid=' . '<USER ID>'. '&pwd=' . '<PASSWORD>'. '&month=' . '<MONTH OF EVENTS>'. '&year=' . '<YEAR OF EVENTS>'. '&eventid=' . '<ID OF EVENT>';
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);