Skip to content

Instantly share code, notes, and snippets.

View CanRau's full-sized avatar
🤓
coding

Can Rau CanRau

🤓
coding
View GitHub Profile
@aruld
aruld / multiline.dart
Created October 19, 2011 17:26
Dart String interpolation and multi-line Strings
main() {
var user = 'John Doe';
var message = """
$user!
Welcome to Programming Dart!
""";
print(message);
}
@somatonic
somatonic / upload_images_to_page_form.php
Created November 26, 2012 22:08
Upload Images to new created Page Form Example
<?php
// front-end form example with multiple images upload
// add new page created on the fly and adding images
$message = '';
if($input->post->submit){
// tmp upload folder for additional security
@somatonic
somatonic / MapPageField.module
Created December 19, 2012 08:32
maps two page fields POC
<?php
class MapPageField extends WireData implements Module{
public static function getModuleInfo(){
return array(
'title' => 'MapPageField',
'version' => 100,
'singular' => true,
'autoload' => true
@somatonic
somatonic / form-process.php
Last active May 24, 2023 18:26
ProcessWire example front-end form with file upload and fields
<?php
// ------------------------------ FORM Processing ---------------------------------------
$errors = null;
$success = false;
// helper function to format form errors
function showError($e){
return "<p class='error'>$e</p>";
@matharchod
matharchod / gist:6137053
Last active December 20, 2015 13:09
jQuery function to scroll to anchor point on page load (split by hash/pound sign)
//scroll to anchor point on page load
function scrollOnLoad() {
try {
//take HREF and split at anchor
var $_elem = $('#' + $(location).attr('href').split('#')[1]);
//find class of anchor element
var $_others = $('.' + $_elem.attr('class'));
//measure window height and element height
//if the window height is smaller that twice the element height, then use regular offset
@rxaviers
rxaviers / gist:7360908
Last active May 7, 2024 22:35
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@jhafner
jhafner / jquery-to-vanilla-js.md
Created December 16, 2013 17:52 — forked from harmstyler/moving_from_jquery.md
jQuery methods in vanilla JavaScript.

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active February 12, 2024 17:18
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@vsouza
vsouza / .bashrc
Last active April 9, 2024 05:27
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@Da-Fecto
Da-Fecto / templates-folder-switch.php
Last active May 6, 2016 05:23
Templates folder switch for ProcessWire
<?php
/**
* Switch ProcessWire templates directory on $_SERVER['HTTP_HOST']. Type the
* Hostname as key and the name of the new templates folder as value.
*
*/
$config->templates = array(
'mobile.domain.dev' => 'templates-mobile', // domain => templates folder name