This is a basic Webpack project template for a web app written in ES6 & LESS.
This assumes you have a directory structure as follows:
package.json
webpack.config.js
src/
var gulp = require('gulp'); | |
var browserSync = require('browser-sync').create(); | |
var setupWatchers = function() { | |
gulp.watch(['./app/views/**/*.erb', | |
'./app/assets/javascripts/**/*.js'], ['reload']); | |
gulp.watch(['./app/assets/stylesheets/**/*.scss'], ['reloadCSS']) | |
}; | |
gulp.task('reload', function(){ |
/******************************************************************************* | |
1. DEPENDENCIES | |
*******************************************************************************/ | |
var gulp = require('gulp'); // gulp core | |
sass = require('gulp-sass'), // sass compiler | |
uglify = require('gulp-uglify'), // uglifies the js | |
jshint = require('gulp-jshint'), // check if js is ok | |
rename = require("gulp-rename"); // rename files | |
concat = require('gulp-concat'), // concatinate js |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
[PHP] | |
;;;;;;;;;;;;;;;;;;; | |
; About php.ini ; | |
;;;;;;;;;;;;;;;;;;; | |
; PHP's initialization file, generally called php.ini, is responsible for | |
; configuring many of the aspects of PHP's behavior. | |
; PHP attempts to find and load this configuration from a number of locations. | |
; The following is a summary of its search order: |
Options FollowSymLinks | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} (\.json)$ | |
RewriteRule ^(.*)$ index.php?rt=$1 [L,QSA] | |
RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ index.php?rt=$1 [L,QSA] |
// sign up | |
account.signUp('[email protected]', 'secret'); | |
// sign in | |
account.signIn('[email protected]', 'secret'); | |
// sign in via oauth | |
account.signInWith('twitter'); | |
// sign out |
# Python OAuth example | |
import evernote.edam.userstore.constants as UserStoreConstants | |
import evernote.edam.type.ttypes as Types | |
from evernote.api.client import EvernoteClient | |
## | |
# Helper function to turn query string parameters into a | |
# Python dictionary | |
## |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
<title>Stripe Getting Started Form</title> | |
<!-- The required Stripe lib --> | |
<script type="text/javascript" src="https://js.stripe.com/v1/"></script> | |
<!-- jQuery is used only for this example; it isn't required to use Stripe --> |
def makeNote(authToken, noteStore, noteTitle, noteBody, parentNotebook=None): | |
nBody = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" | |
nBody += "<!DOCTYPE en-note SYSTEM \"http://xml.evernote.com/pub/enml2.dtd\">" | |
nBody += "<en-note>%s</en-note>" % noteBody | |
## Create note object | |
ourNote = Types.Note() | |
ourNote.title = noteTitle | |
ourNote.content = nBody |